qTranslate X - Version 3.4.6.5

Version Description

Download this release

Release Info

Developer johnclause
Plugin Icon wp plugin qTranslate X
Version 3.4.6.5
Comparing to
See all releases

Code changes from version 3.2.9 to 3.4.6.5

Files changed (574) hide show
  1. admin/activation_hook.php +0 -260
  2. admin/css/opHighlightMode/Border_Around.css +7 -0
  3. admin/css/opHighlightMode/Left_Border.css +4 -0
  4. admin/css/opLSBStyle/Simple_Buttons.css +37 -0
  5. admin/css/opLSBStyle/Simple_Tabs.css +52 -0
  6. admin/css/opLSBStyle/Tabs_in_Block.css +33 -0
  7. admin/css/qtranslate_configuration.css +102 -0
  8. admin/i18n-interface-admin.php +20 -0
  9. admin/import_export.php +0 -189
  10. admin/js/common.js +793 -503
  11. admin/js/common.min.js +1 -1
  12. admin/js/edit-custom-page.js +0 -20
  13. admin/js/edit-custom-page.min.js +0 -1
  14. admin/js/edit-nav-menus.js +0 -67
  15. admin/js/edit-nav-menus.min.js +0 -1
  16. admin/js/edit-options-general.js +0 -16
  17. admin/js/edit-options-general.min.js +0 -1
  18. admin/js/edit-post.js +0 -111
  19. admin/js/edit-post.min.js +0 -1
  20. admin/js/edit-tag-exec.js +19 -0
  21. admin/js/edit-tag-exec.min.js +1 -0
  22. admin/js/edit-tag.js +0 -24
  23. admin/js/edit-tag.min.js +0 -1
  24. admin/js/edit-tags-exec.js +34 -0
  25. admin/js/edit-tags-exec.min.js +1 -0
  26. admin/js/edit-tags.js +0 -79
  27. admin/js/edit-tags.min.js +0 -1
  28. admin/js/nav-menus-exec.js +57 -0
  29. admin/js/nav-menus-exec.min.js +1 -0
  30. admin/js/options.js +105 -0
  31. admin/js/options.min.js +1 -0
  32. admin/js/post-exec.js +123 -0
  33. admin/js/post-exec.min.js +1 -0
  34. admin/js/widgets-exec.js +24 -0
  35. admin/js/widgets-exec.min.js +1 -0
  36. admin/qtx_activation_hook.php +1021 -0
  37. admin/qtx_admin.php +828 -0
  38. admin/qtx_admin_class_translator.php +28 -0
  39. admin/qtx_admin_options.php +108 -0
  40. admin/qtx_admin_options_update.php +794 -0
  41. admin/{admin_utils.php → qtx_admin_utils.php} +353 -41
  42. admin/qtx_configuration.php +744 -0
  43. admin/qtx_import_export.php +228 -0
  44. admin/qtx_languages.php +124 -0
  45. admin/qtx_update_gettext_db.php +68 -0
  46. admin/qtx_user_options.php +47 -0
  47. admin/update-gettext-db.php +0 -35
  48. arrowdown.png +0 -0
  49. arrowup.png +0 -0
  50. flags/aa.png +0 -0
  51. flags/ad.alt.png +0 -0
  52. flags/ad.png +0 -0
  53. flags/ae.png +0 -0
  54. flags/af.png +0 -0
  55. flags/ag.png +0 -0
  56. flags/ai.alt.png +0 -0
  57. flags/ai.png +0 -0
  58. flags/al.png +0 -0
  59. flags/am.png +0 -0
  60. flags/an.png +0 -0
  61. flags/ao.png +0 -0
  62. flags/aq.png +0 -0
  63. flags/ar.alt.png +0 -0
  64. flags/ar.png +0 -0
  65. flags/arle.png +0 -0
  66. flags/as.png +0 -0
  67. flags/at.alt.png +0 -0
  68. flags/at.png +0 -0
  69. flags/au.png +0 -0
  70. flags/aw.png +0 -0
  71. flags/ax.png +0 -0
  72. flags/az.png +0 -0
  73. flags/ba.png +0 -0
  74. flags/bb.png +0 -0
  75. flags/bd.png +0 -0
  76. flags/be.png +0 -0
  77. flags/bf.png +0 -0
  78. flags/bg.png +0 -0
  79. flags/bh.png +0 -0
  80. flags/bi.alt.png +0 -0
  81. flags/bi.png +0 -0
  82. flags/bj.png +0 -0
  83. flags/bl.png +0 -0
  84. flags/bm.png +0 -0
  85. flags/bn.png +0 -0
  86. flags/bo.png +0 -0
  87. flags/bq.png +0 -0
  88. flags/br.png +0 -0
  89. flags/bs.png +0 -0
  90. flags/bt.png +0 -0
  91. flags/bv.png +0 -0
  92. flags/bw.png +0 -0
  93. flags/by.png +0 -0
  94. flags/bz.png +0 -0
  95. flags/ca.alt.png +0 -0
  96. flags/ca.png +0 -0
  97. flags/catala.png +0 -0
  98. flags/cc.alt.png +0 -0
  99. flags/cc.png +0 -0
  100. flags/cd.png +0 -0
  101. flags/cf.png +0 -0
  102. flags/cg.png +0 -0
  103. flags/ch.png +0 -0
  104. flags/ci.png +0 -0
  105. flags/ck.png +0 -0
  106. flags/cl.png +0 -0
  107. flags/cm.png +0 -0
  108. flags/cn.png +0 -0
  109. flags/co.png +0 -0
  110. flags/cr.alt.png +0 -0
  111. flags/cr.png +0 -0
  112. flags/cs.png +0 -0
  113. flags/cu.png +0 -0
  114. flags/cv.png +0 -0
  115. flags/cw.png +0 -0
  116. flags/cx.png +0 -0
  117. flags/cy.png +0 -0
  118. flags/cy_GB.png +0 -0
  119. flags/cz.png +0 -0
  120. flags/de.png +0 -0
  121. flags/dj.png +0 -0
  122. flags/dk.png +0 -0
  123. flags/dm.png +0 -0
  124. flags/do.png +0 -0
  125. flags/dz.png +0 -0
  126. flags/ec.alt.png +0 -0
  127. flags/ec.png +0 -0
  128. flags/ee.png +0 -0
  129. flags/eg.png +0 -0
  130. flags/eh.alt.png +0 -0
  131. flags/eh.png +0 -0
  132. flags/eo.png +0 -0
  133. flags/er.png +0 -0
  134. flags/es.alt.png +0 -0
  135. flags/es.png +0 -0
  136. flags/et.alt.png +0 -0
  137. flags/et.png +0 -0
  138. flags/eu.png +0 -0
  139. flags/eu_ES.png +0 -0
  140. flags/fi.png +0 -0
  141. flags/fj.png +0 -0
  142. flags/fk.png +0 -0
  143. flags/fo.png +0 -0
  144. flags/fr.png +0 -0
  145. flags/ga.png +0 -0
  146. flags/galego.png +0 -0
  147. flags/gb.png +0 -0
  148. flags/gd.png +0 -0
  149. flags/ge.png +0 -0
  150. flags/gf.png +0 -0
  151. flags/gg.png +0 -0
  152. flags/gh.png +0 -0
  153. flags/gi.png +0 -0
  154. flags/gl.png +0 -0
  155. flags/gm.png +0 -0
  156. flags/gn.png +0 -0
  157. flags/gp.png +0 -0
  158. flags/gq.png +0 -0
  159. flags/gr.png +0 -0
  160. flags/gs.png +0 -0
  161. flags/gt.alt.png +0 -0
  162. flags/gt.png +0 -0
  163. flags/gu.png +0 -0
  164. flags/gw.png +0 -0
  165. flags/gy.png +0 -0
  166. flags/hk.png +0 -0
  167. flags/hm.png +0 -0
  168. flags/hn.png +0 -0
  169. flags/hr.png +0 -0
  170. flags/ht.alt.png +0 -0
  171. flags/ht.png +0 -0
  172. flags/hu.png +0 -0
  173. flags/id.png +0 -0
  174. flags/ie.png +0 -0
  175. flags/il.png +0 -0
  176. flags/im.png +0 -0
  177. flags/in.png +0 -0
  178. flags/io.png +0 -0
  179. flags/iq.png +0 -0
  180. flags/ir.png +0 -0
  181. flags/is.png +0 -0
  182. flags/it.png +0 -0
  183. flags/je.png +0 -0
  184. flags/jm.png +0 -0
  185. flags/jo.png +0 -0
  186. flags/jp.png +0 -0
  187. flags/ke.png +0 -0
  188. flags/kg.png +0 -0
  189. flags/kh.png +0 -0
  190. flags/ki.png +0 -0
  191. flags/km.png +0 -0
  192. flags/kn.png +0 -0
  193. flags/kp.png +0 -0
  194. flags/kr.png +0 -0
  195. flags/kw.png +0 -0
  196. flags/ky.png +0 -0
  197. flags/kz.png +0 -0
  198. flags/la.png +0 -0
  199. flags/lb.png +0 -0
  200. flags/li.png +0 -0
  201. flags/lk.png +0 -0
  202. flags/lr.png +0 -0
  203. flags/ls.png +0 -0
  204. flags/lt.png +0 -0
  205. flags/lu.png +0 -0
  206. flags/lv.png +0 -0
  207. flags/ly.png +0 -0
  208. flags/ma.png +0 -0
  209. flags/mc.png +0 -0
  210. flags/md.png +0 -0
  211. flags/me.png +0 -0
  212. flags/mf.png +0 -0
  213. flags/mg.png +0 -0
  214. flags/mh.png +0 -0
  215. flags/mk.png +0 -0
  216. flags/ml.png +0 -0
  217. flags/mm.png +0 -0
  218. flags/mn.png +0 -0
  219. flags/mo.png +0 -0
  220. flags/mp.png +0 -0
  221. flags/mq.png +0 -0
  222. flags/mr.png +0 -0
  223. flags/ms.png +0 -0
  224. flags/mt.png +0 -0
  225. flags/mu.png +0 -0
  226. flags/mv.png +0 -0
  227. flags/mw.png +0 -0
  228. flags/mx.png +0 -0
  229. flags/my.png +0 -0
  230. flags/mz.png +0 -0
  231. flags/na.png +0 -0
  232. flags/nc.png +0 -0
  233. flags/ne.png +0 -0
  234. flags/nf.png +0 -0
  235. flags/ng.png +0 -0
  236. flags/ni.alt.png +0 -0
  237. flags/ni.png +0 -0
  238. flags/nl.png +0 -0
  239. flags/no.png +0 -0
  240. flags/np.png +0 -0
  241. flags/nr.png +0 -0
  242. flags/nu.png +0 -0
  243. flags/nz.png +0 -0
  244. flags/om.png +0 -0
  245. flags/pa.png +0 -0
  246. flags/pe.png +0 -0
  247. flags/pf.alt.png +0 -0
  248. flags/pf.png +0 -0
  249. flags/pg.png +0 -0
  250. flags/ph.png +0 -0
  251. flags/pk.png +0 -0
  252. flags/pl.png +0 -0
  253. flags/pm.png +0 -0
  254. flags/pn.png +0 -0
  255. flags/pr.png +0 -0
  256. flags/ps.png +0 -0
  257. flags/pt.png +0 -0
  258. flags/pw.png +0 -0
  259. flags/py.png +0 -0
  260. flags/qa.png +0 -0
  261. flags/re.png +0 -0
  262. flags/ro.png +0 -0
  263. flags/rs.png +0 -0
  264. flags/ru.png +0 -0
  265. flags/rw.png +0 -0
  266. flags/sa.png +0 -0
  267. flags/sb.png +0 -0
  268. flags/sc.png +0 -0
  269. flags/sd.png +0 -0
  270. flags/sg.png +0 -0
  271. flags/sh.png +0 -0
  272. flags/si.png +0 -0
  273. flags/sj.png +0 -0
  274. flags/sk.png +0 -0
  275. flags/sl.png +0 -0
  276. flags/sm.png +0 -0
  277. flags/sn.png +0 -0
  278. flags/so.png +0 -0
  279. flags/sr.png +0 -0
  280. flags/ss.png +0 -0
  281. flags/st.png +0 -0
  282. flags/sv.alt.png +0 -0
  283. flags/sv.png +0 -0
  284. flags/sx.png +0 -0
  285. flags/sy.png +0 -0
  286. flags/sz.png +0 -0
  287. flags/tc.png +0 -0
  288. flags/td.png +0 -0
  289. flags/tf.png +0 -0
  290. flags/tg.png +0 -0
  291. flags/th.png +0 -0
  292. flags/tj.png +0 -0
  293. flags/tk.png +0 -0
  294. flags/tl.png +0 -0
  295. flags/tm.png +0 -0
  296. flags/tn.png +0 -0
  297. flags/to.png +0 -0
  298. flags/tr.png +0 -0
  299. flags/tt.png +0 -0
  300. flags/tv.png +0 -0
  301. flags/tw.png +0 -0
  302. flags/tz.png +0 -0
  303. flags/ua.png +0 -0
  304. flags/ug.png +0 -0
  305. flags/uk.png +0 -0
  306. flags/um.png +0 -0
  307. flags/us.png +0 -0
  308. flags/uy.png +0 -0
  309. flags/uz.png +0 -0
  310. flags/va.png +0 -0
  311. flags/vc.png +0 -0
  312. flags/ve.png +0 -0
  313. flags/vg.png +0 -0
  314. flags/vi.png +0 -0
  315. flags/vn.png +0 -0
  316. flags/vu.png +0 -0
  317. flags/wf.alt.png +0 -0
  318. flags/wf.png +0 -0
  319. flags/ws.png +0 -0
  320. flags/ye.png +0 -0
  321. flags/yt.png +0 -0
  322. flags/yu.png +0 -0
  323. flags/za.png +0 -0
  324. flags/zm.png +0 -0
  325. flags/zw.png +0 -0
  326. flags/zz.png +0 -0
  327. i18n-config.json +180 -0
  328. i18n-config/plugins/bbpress/i18n-config.json +11 -0
  329. i18n-config/plugins/events-made-easy/i18n-config.json +275 -0
  330. i18n-config/plugins/types/i18n-config.json +16 -0
  331. i18n-config/plugins/watupro/i18n-config.json +80 -0
  332. i18n-config/themes/eventor/i18n-config.json +74 -0
  333. i18n-config/themes/magnium/i18n-config.json +15 -0
  334. i18n-config/themes/ta-pluton/i18n-config.json +57 -0
  335. inc/i18n-interface.php +81 -0
  336. inc/qtx_class_translator.php +56 -0
  337. inc/qtx_dbg.php +64 -0
  338. lang/language-names/language-af.mo +0 -0
  339. lang/language-names/language-ak.mo +0 -0
  340. lang/language-names/language-am.mo +0 -0
  341. lang/language-names/language-ar.mo +0 -0
  342. lang/language-names/language-arq.mo +0 -0
  343. lang/language-names/language-ary.mo +0 -0
  344. lang/language-names/language-as.mo +0 -0
  345. lang/language-names/language-az.mo +0 -0
  346. lang/language-names/language-az_TR.mo +0 -0
  347. lang/language-names/language-azb.mo +0 -0
  348. lang/language-names/language-ba.mo +0 -0
  349. lang/language-names/language-bal.mo +0 -0
  350. lang/language-names/language-bcc.mo +0 -0
  351. lang/language-names/language-bel.mo +0 -0
  352. lang/language-names/language-bg_BG.mo +0 -0
  353. lang/language-names/language-bn_BD.mo +0 -0
  354. lang/language-names/language-bo.mo +0 -0
  355. lang/language-names/language-bre.mo +0 -0
  356. lang/language-names/language-bs_BA.mo +0 -0
  357. lang/language-names/language-ca.mo +0 -0
  358. lang/language-names/language-ckb.mo +0 -0
  359. lang/language-names/language-co.mo +0 -0
  360. lang/language-names/language-cs_CZ.mo +0 -0
  361. lang/language-names/language-cy.mo +0 -0
  362. lang/language-names/language-da_DK.mo +0 -0
  363. lang/language-names/language-de_CH.mo +0 -0
  364. lang/language-names/language-de_DE.mo +0 -0
  365. lang/language-names/language-dv.mo +0 -0
  366. lang/language-names/language-dzo.mo +0 -0
  367. lang/language-names/language-el.mo +0 -0
  368. lang/language-names/language-en.mo +0 -0
  369. lang/language-names/language-en_AU.mo +0 -0
  370. lang/language-names/language-en_CA.mo +0 -0
  371. lang/language-names/language-en_GB.mo +0 -0
  372. lang/language-names/language-en_NZ.mo +0 -0
  373. lang/language-names/language-en_US.mo +0 -0
  374. lang/language-names/language-en_ZA.mo +0 -0
  375. lang/language-names/language-eo.mo +0 -0
  376. lang/language-names/language-es_AR.mo +0 -0
  377. lang/language-names/language-es_CL.mo +0 -0
  378. lang/language-names/language-es_CO.mo +0 -0
  379. lang/language-names/language-es_ES.mo +0 -0
  380. lang/language-names/language-es_MX.mo +0 -0
  381. lang/language-names/language-es_PE.mo +0 -0
  382. lang/language-names/language-es_PR.mo +0 -0
  383. lang/language-names/language-es_VE.mo +0 -0
  384. lang/language-names/language-et.mo +0 -0
  385. lang/language-names/language-eu.mo +0 -0
  386. lang/language-names/language-fa_AF.mo +0 -0
  387. lang/language-names/language-fa_IR.mo +0 -0
  388. lang/language-names/language-fi.mo +0 -0
  389. lang/language-names/language-fo.mo +0 -0
  390. lang/language-names/language-fr_BE.mo +0 -0
  391. lang/language-names/language-fr_CA.mo +0 -0
  392. lang/language-names/language-fr_FR.mo +0 -0
  393. lang/language-names/language-frp.mo +0 -0
  394. lang/language-names/language-fuc.mo +0 -0
  395. lang/language-names/language-fur.mo +0 -0
  396. lang/language-names/language-fy.mo +0 -0
  397. lang/language-names/language-ga.mo +0 -0
  398. lang/language-names/language-gd.mo +0 -0
  399. lang/language-names/language-gl_ES.mo +0 -0
  400. lang/language-names/language-gn.mo +0 -0
  401. lang/language-names/language-gsw.mo +0 -0
  402. lang/language-names/language-gu.mo +0 -0
  403. lang/language-names/language-haw_US.mo +0 -0
  404. lang/language-names/language-haz.mo +0 -0
  405. lang/language-names/language-he_IL.mo +0 -0
  406. lang/language-names/language-hi_IN.mo +0 -0
  407. lang/language-names/language-hr.mo +0 -0
  408. lang/language-names/language-hu_HU.mo +0 -0
  409. lang/language-names/language-hy.mo +0 -0
  410. lang/language-names/language-id_ID.mo +0 -0
  411. lang/language-names/language-ido.mo +0 -0
  412. lang/language-names/language-is_IS.mo +0 -0
  413. lang/language-names/language-it_IT.mo +0 -0
  414. lang/language-names/language-ja.mo +0 -0
  415. lang/language-names/language-jv_ID.mo +0 -0
  416. lang/language-names/language-ka_GE.mo +0 -0
  417. lang/language-names/language-kab.mo +0 -0
  418. lang/language-names/language-kin.mo +0 -0
  419. lang/language-names/language-kk.mo +0 -0
  420. lang/language-names/language-km.mo +0 -0
  421. lang/language-names/language-kn.mo +0 -0
  422. lang/language-names/language-ko_KR.mo +0 -0
  423. lang/language-names/language-ky_KY.mo +0 -0
  424. lang/language-names/language-lb_LU.mo +0 -0
  425. lang/language-names/language-li.mo +0 -0
  426. lang/language-names/language-lin.mo +0 -0
  427. lang/language-names/language-lo.mo +0 -0
  428. lang/language-names/language-lt_LT.mo +0 -0
  429. lang/language-names/language-lv.mo +0 -0
  430. lang/language-names/language-me_ME.mo +0 -0
  431. lang/language-names/language-mg_MG.mo +0 -0
  432. lang/language-names/language-mk_MK.mo +0 -0
  433. lang/language-names/language-ml_IN.mo +0 -0
  434. lang/language-names/language-mn.mo +0 -0
  435. lang/language-names/language-mr.mo +0 -0
  436. lang/language-names/language-mri.mo +0 -0
  437. lang/language-names/language-ms_MY.mo +0 -0
  438. lang/language-names/language-my_MM.mo +0 -0
  439. lang/language-names/language-nb_NO.mo +0 -0
  440. lang/language-names/language-ne_NP.mo +0 -0
  441. lang/language-names/language-nl_BE.mo +0 -0
  442. lang/language-names/language-nl_NL.mo +0 -0
  443. lang/language-names/language-nn_NO.mo +0 -0
  444. lang/language-names/language-oci.mo +0 -0
  445. lang/language-names/language-ory.mo +0 -0
  446. lang/language-names/language-os.mo +0 -0
  447. lang/language-names/language-pa_IN.mo +0 -0
  448. lang/language-names/language-pl_PL.mo +0 -0
  449. lang/language-names/language-ps.mo +0 -0
  450. lang/language-names/language-pt_BR.mo +0 -0
  451. lang/language-names/language-pt_PT.mo +0 -0
  452. lang/language-names/language-rhg.mo +0 -0
  453. lang/language-names/language-ro_RO.mo +0 -0
  454. lang/language-names/language-roh.mo +0 -0
  455. lang/language-names/language-ru_RU.mo +0 -0
  456. lang/language-names/language-ru_UA.mo +0 -0
  457. lang/language-names/language-rue.mo +0 -0
  458. lang/language-names/language-rup_MK.mo +0 -0
  459. lang/language-names/language-sa_IN.mo +0 -0
  460. lang/language-names/language-sah.mo +0 -0
  461. lang/language-names/language-sd_PK.mo +0 -0
  462. lang/language-names/language-si_LK.mo +0 -0
  463. lang/language-names/language-sk_SK.mo +0 -0
  464. lang/language-names/language-sl_SI.mo +0 -0
  465. lang/language-names/language-so_SO.mo +0 -0
  466. lang/language-names/language-sq.mo +0 -0
  467. lang/language-names/language-sr_RS.mo +0 -0
  468. lang/language-names/language-srd.mo +0 -0
  469. lang/language-names/language-su_ID.mo +0 -0
  470. lang/language-names/language-sv_SE.mo +0 -0
  471. lang/language-names/language-sw.mo +0 -0
  472. lang/language-names/language-szl.mo +0 -0
  473. lang/language-names/language-ta_IN.mo +0 -0
  474. lang/language-names/language-ta_LK.mo +0 -0
  475. lang/language-names/language-te.mo +0 -0
  476. lang/language-names/language-tg.mo +0 -0
  477. lang/language-names/language-th.mo +0 -0
  478. lang/language-names/language-tir.mo +0 -0
  479. lang/language-names/language-tl.mo +0 -0
  480. lang/language-names/language-tr_TR.mo +0 -0
  481. lang/language-names/language-tt_RU.mo +0 -0
  482. lang/language-names/language-tuk.mo +0 -0
  483. lang/language-names/language-tzm.mo +0 -0
  484. lang/language-names/language-ug_CN.mo +0 -0
  485. lang/language-names/language-uk.mo +0 -0
  486. lang/language-names/language-ur.mo +0 -0
  487. lang/language-names/language-uz_UZ.mo +0 -0
  488. lang/language-names/language-vi.mo +0 -0
  489. lang/language-names/language-wa.mo +0 -0
  490. lang/language-names/language-xmf.mo +0 -0
  491. lang/language-names/language-yor.mo +0 -0
  492. lang/language-names/language-zh_CN.mo +0 -0
  493. lang/language-names/language-zh_HK.mo +0 -0
  494. lang/language-names/language-zh_TW.mo +0 -0
  495. lang/qtranslate-ar.mo +0 -0
  496. lang/qtranslate-az_AZ.mo +0 -0
  497. lang/qtranslate-az_AZ.po +0 -1192
  498. lang/qtranslate-bg_BG.mo +0 -0
  499. lang/qtranslate-bg_BG.po +0 -1204
  500. lang/qtranslate-ca.mo +0 -0
  501. lang/qtranslate-cs_CZ.mo +0 -0
  502. lang/qtranslate-cs_CZ.po +0 -1151
  503. lang/qtranslate-da_DK.mo +0 -0
  504. lang/qtranslate-da_DK.po +0 -1207
  505. lang/qtranslate-de_DE.mo +0 -0
  506. lang/qtranslate-de_DE.po +0 -1239
  507. lang/qtranslate-el.mo +0 -0
  508. lang/qtranslate-el_GR.mo +0 -0
  509. lang/qtranslate-eo.mo +0 -0
  510. lang/qtranslate-eo.po +0 -1124
  511. lang/qtranslate-es_CA.mo +0 -0
  512. lang/qtranslate-es_CA.po +0 -1207
  513. lang/qtranslate-es_ES.mo +0 -0
  514. lang/qtranslate-es_ES.po +0 -1206
  515. lang/qtranslate-fr_FR.mo +0 -0
  516. lang/qtranslate-fr_FR.po +0 -1256
  517. lang/qtranslate-hr.mo +0 -0
  518. lang/qtranslate-hr_HR.mo +0 -0
  519. lang/qtranslate-hr_HR.po +0 -1180
  520. lang/qtranslate-hu_HU.mo +0 -0
  521. lang/qtranslate-hu_HU.po +0 -1123
  522. lang/qtranslate-id_ID.mo +0 -0
  523. lang/qtranslate-id_ID.po +0 -1204
  524. lang/qtranslate-it_IT.mo +0 -0
  525. lang/qtranslate-it_IT.po +0 -1204
  526. lang/qtranslate-ja.mo +0 -0
  527. lang/qtranslate-ja_JP.mo +0 -0
  528. lang/qtranslate-ja_JP.po +0 -1207
  529. lang/qtranslate-mk_MK.mo +0 -0
  530. lang/qtranslate-mk_MK.po +0 -1187
  531. lang/qtranslate-ms_MY.mo +0 -0
  532. lang/qtranslate-ms_MY.po +0 -1208
  533. lang/qtranslate-nl_NL.mo +0 -0
  534. lang/qtranslate-nl_NL.po +0 -1117
  535. lang/qtranslate-pl_PL.mo +0 -0
  536. lang/qtranslate-pl_PL.po +0 -1206
  537. lang/qtranslate-pt_BR.mo +0 -0
  538. lang/qtranslate-pt_BR.po +0 -1140
  539. lang/qtranslate-pt_PT.mo +0 -0
  540. lang/qtranslate-pt_PT.po +0 -1214
  541. lang/qtranslate-ro_RO.mo +0 -0
  542. lang/qtranslate-ro_RO.po +0 -1204
  543. lang/qtranslate-ru_RU.mo +0 -0
  544. lang/qtranslate-ru_RU.po +0 -1157
  545. lang/qtranslate-sr_RS.mo +0 -0
  546. lang/qtranslate-sr_RS.po +0 -1192
  547. lang/qtranslate-sv_SE.mo +0 -0
  548. lang/qtranslate-sv_SE.po +0 -1170
  549. lang/qtranslate-tr_TR.mo +0 -0
  550. lang/qtranslate-tr_TR.po +0 -1192
  551. lang/qtranslate-zh_CN.mo +0 -0
  552. lang/qtranslate-zh_CN.po +0 -1208
  553. lang/qtranslate.pot +0 -1112
  554. lang/translators-notes.txt +17 -0
  555. license.txt +674 -674
  556. qtranslate.php +77 -503
  557. qtranslate_compatibility.php +24 -6
  558. qtranslate_configuration.css +0 -176
  559. qtranslate_configuration.php +0 -1414
  560. qtranslate_core.php +451 -494
  561. qtranslate_frontend.php +705 -230
  562. qtranslate_hooks.php +136 -109
  563. qtranslate_options.php +645 -0
  564. qtranslate_services.php +0 -948
  565. qtranslate_utils.php +503 -95
  566. qtranslate_widget.php +119 -63
  567. readme.txt +346 -195
  568. screenshot-1.png +0 -0
  569. screenshot-2.png +0 -0
  570. screenshot-3.png +0 -0
  571. screenshot-4.png +0 -0
  572. screenshot-5.png +0 -0
  573. screenshot-6.png +0 -0
  574. screenshot-7.png +0 -0
admin/activation_hook.php DELETED
@@ -1,260 +0,0 @@
1
- <?php // encoding: utf-8
2
- /*
3
- Copyright 2014 qTranslate Team (email : qTranslateTeam@gmail.com )
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation; either version 2 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program; if not, write to the Free Software
17
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
- */
19
-
20
- function qtranxf_admin_notice_deactivate_plugin($nm,$plugin)
21
- {
22
- deactivate_plugins($plugin,true);
23
- $d=dirname($plugin);
24
- $link='<a href="https://wordpress.org/plugins/'.$d.'/" target="_blank">'.$nm.'</a>';
25
- $qtxnm='qTranslate&#8209;X';
26
- $qtxlink='<a href="https://wordpress.org/plugins/qtranslate-x/" target="_blank">'.$qtxnm.'</a>';
27
- $f='qtranxf_migrate_import_'.str_replace('-','_',dirname($plugin));
28
- $imported=false;
29
- if(function_exists($f)){
30
- global $wpdb;
31
- $options = $wpdb->get_col("SELECT `option_name` FROM {$wpdb->options} WHERE `option_name` LIKE 'qtranslate_%'");
32
- if(empty($options)){
33
- $f();
34
- $imported=true;
35
- }
36
- }
37
- $s = '</p><p>'.sprintf(__('It might be a good idea to review %smigration instructions%s, if you have not yet done so.', 'qtranslate'),'<a href="https://qtranslatexteam.wordpress.com/2015/02/24/migration-from-other-multilingual-plugins/" target="_blank">','</a>').'</p><p><a class="button" href="">';
38
- $msg=sprintf(__('Activation of plugin %s deactivated plugin %s since they cannot run simultaneously.', 'qtranslate'), $qtxlink, $link).' ';
39
- if($imported){
40
- $msg.=sprintf(__('The compatible settings from %s have been imported to %s. Further tuning, import, export and reset of options can be done at Settings/Languages configuration page, once %s is running.%sContinue%s', 'qtranslate'), $nm, $qtxnm, $qtxnm, $s, '</a>');
41
- }else{
42
- $msg.=sprintf(__('You may import/export compatible settings from %s to %s on Settings/Languages configuration page, once %s is running.%sContinue%s', 'qtranslate'), $nm, $qtxnm, $qtxnm, $s, '</a>');
43
- }
44
- //$nonce=wp_create_nonce('deactivate-plugin_'.$plugin);
45
- //$msg=sprintf(__('Plugin %s cannot run concurrently with %s, please %sdeactivate %s%s. You may import compatible settings from %s to %s on Settings/Languages configuration page, once %s is running.','qtranslate'),$qtxlink,$link,'<a href="'.admin_url('plugins.php?action=deactivate&plugin='.encode($plugin).'&plugin_status=all&paged=1&s&_wpnonce='.$nonce.'">',$nm,'</a>',$nm,$qtxnm,$qtxnm);
46
- //$msg=sprintf(__('Activation of plugin %s deactivated plugin %s since they cannot run simultaneously. You may import compatible settings from %s to %s on Settings/%sLanguages%s configuration page, once %s is running.%sContinue%s','qtranslate'),$qtxlink,$link,$nm,$qtxnm,'<a href="'.admin_url('/options-general.php?page=qtranslate-x').'">','</a>',$qtxnm,'</p><p><a class="button" href="">','</a>');
47
- wp_die('<p>'.$msg.'</p>');
48
- }
49
-
50
- function qtranxf_activation_hook()
51
- {
52
- // Check if other qTranslate forks are activated.
53
- if ( is_plugin_active( 'mqtranslate/mqtranslate.php' ) )
54
- qtranxf_admin_notice_deactivate_plugin('mqTranslate','mqtranslate/mqtranslate.php');
55
-
56
- if ( is_plugin_active( 'qtranslate/qtranslate.php' ) )
57
- qtranxf_admin_notice_deactivate_plugin('qTranslate','qtranslate/qtranslate.php');
58
-
59
- if ( is_plugin_active( 'qtranslate-xp/ppqtranslate.php' ) )
60
- qtranxf_admin_notice_deactivate_plugin('qTranslate Plus','qtranslate-xp/ppqtranslate.php');
61
-
62
- if ( is_plugin_active( 'ztranslate/ztranslate.php' ) )
63
- qtranxf_admin_notice_deactivate_plugin('zTranslate','ztranslate/ztranslate.php');
64
-
65
- //deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself
66
- }
67
-
68
- /*
69
- function qtranxf_admin_notice_deactivated($plugin)
70
- {
71
- $plugin_file=WP_CONTENT_DIR.'/plugins/'.$plugin;
72
- $plugin_data=get_plugin_data( plugin_file, false, true );
73
- echo "qtranxf_admin_notice_deactivated: $plugin";
74
- var_dump($plugin_data);
75
- if(!$plugin_data) return;
76
- $nm='<a href="https://wordpress.org/plugins/'.dirname($plugin).'/">'.$plugin_data['Name'].'</a>';
77
- echo printf(__('Plugin qTranslate&#8209;X deactivated plugin %s since they cannot run simultaneously. You may import compatible settings from %s to qTranslate&#8209;X on Settings/"<a href="%s">Languages</a>" configuration page.','qtranslate'),$nm,$nm,admin_url('options-general.php?page=qtranslate-x'));
78
- }
79
-
80
- function qtranxf_admin_notices($nm)
81
- {
82
- //if($_SERVER['REQUEST_METHOD']!='GET') return;
83
- if(isset($_REQUEST['qtx_dismiss'])){
84
- update_option('qtranslate_admin_notices',array());
85
- return;
86
- }
87
- $admin_notices=get_option('qtranslate_admin_notices',array());
88
- if(empty($admin_notices)) return;
89
- //echo '<div class="updated">';
90
- echo '<div class="update-nag">';
91
- echo '<div style="float: right"><a href="?qtx_dismiss"><small>dismiss</small></a></div>';
92
- foreach($admin_notices as $key=>$notice){
93
- echo '<p>';
94
- switch($key){
95
- case 'mqtranslate/mqtranslate.php':
96
- case 'qtranslate/qtranslate.php':
97
- case 'qtranslate-xp/ppqtranslate.php':
98
- case 'ztranslate/ztranslate.php':
99
- qtranxf_admin_notice_deactivated($key);
100
- break;
101
- default: echo $notice; break;
102
- }
103
- echo '</p>';
104
- }
105
- echo '</div>';
106
- }
107
-
108
- function qtranxf_check_qtranslate_other()
109
- {
110
- // Check if other qTranslate forks are active.
111
- $plugins=array();
112
- if(is_plugin_active('mqtranslate/mqtranslate.php')) $plugins[]='qtranslate-xp/ppqtranslate.php';
113
- if(is_plugin_active('qtranslate/qtranslate.php')) $plugins[]='qtranslate/qtranslate.php';
114
- if(is_plugin_active('qtranslate-xp/ppqtranslate.php')) $plugins[]='qtranslate-xp/ppqtranslate.php';
115
- if(is_plugin_active('ztranslate/ztranslate.php')) $plugins[]='ztranslate/ztranslate.php';
116
- if(empty($plugins)) return;
117
- $admin_notices=get_option('qtranslate_admin_notices',array());
118
- $t=time();
119
- foreach($plugins as $plugin){
120
- $admin_notices[$plugin]=$t;
121
- }
122
- deactivate_plugins($plugins,true);
123
- add_action('admin_notices', 'qtranxf_admin_notices');
124
- }
125
- //muplugins_loaded plugins_loaded
126
- //add_action('admin_init', 'qtranxf_check_qtranslate_other', 0);
127
- */
128
-
129
- function qtranxf_admin_notice_plugin_conflict($title,$plugin)
130
- {
131
- if(!is_plugin_active($plugin)) return;
132
- $me='<a href="https://wordpress.org/plugins/qtranslate-x/" style="color:blue" target="_blank">qTranslate&#8209;X</a>';
133
- $link='<a href="https://wordpress.org/plugins/'.dirname($plugin).'/" style="color:magenta" target="_blank">'.$title.'</a>';
134
- echo '<div class="error"><p style="font-size: larger">';
135
- printf(__('%sError:%s plugin %s cannot run concurrently with plugin %s. You may import and export compatible settings between %s and %s on Settings/<a href="%s">Languages</a> configuration page. Then you have to deactivate one of the plugins to continue.','qtranslate'),'<span style="color:red"><strong>','</strong></span>',$me,$link,'qTranslate&#8209;X',$title,admin_url('options-general.php?page=qtranslate-x'), 'qtranslate');
136
- echo ' ';
137
- printf(__('It might be a good idea to review %smigration instructions%s, if you have not yet done so.', 'qtranslate'),'<a href="https://qtranslatexteam.wordpress.com/2015/02/24/migration-from-other-multilingual-plugins/" target="_blank">','</a>');
138
-
139
- $nonce=wp_create_nonce('deactivate-plugin_'.$plugin);
140
- echo '</p><p> &nbsp; &nbsp; &nbsp; &nbsp;<a class="button" href="'.admin_url('plugins.php?action=deactivate&plugin='.urlencode($plugin).'&plugin_status=all&paged=1&s&_wpnonce='.$nonce).'"><strong>'.sprintf(__('Deactivate %s', 'qtranslate'), '<span style="color:magenta">'.$title.'</span>').'</strong></a>';
141
- $nonce=wp_create_nonce('deactivate-plugin_qtranslate-x/qtranslate.php');
142
- echo ' &nbsp; &nbsp; &nbsp; &nbsp;<a class="button" href="'.admin_url('plugins.php?action=deactivate&plugin='.urlencode('qtranslate-x/qtranslate.php').'&plugin_status=all&paged=1&s&_wpnonce='.$nonce).'"><strong>'.sprintf(__('Deactivate %s', 'qtranslate'), '<span style="color:blue">qTranslate&#8209;X</span>').'</strong></a>';
143
- echo '</p></div>';
144
- }
145
-
146
- function qtranxf_admin_notices_plugin_conflicts()
147
- {
148
- qtranxf_admin_notice_plugin_conflict('qTranslate','qtranslate/qtranslate.php');
149
- qtranxf_admin_notice_plugin_conflict('mqTranslate','mqtranslate/mqtranslate.php');
150
- qtranxf_admin_notice_plugin_conflict('qTranslate Plus','qtranslate-xp/ppqtranslate.php');
151
- qtranxf_admin_notice_plugin_conflict('zTranslate','ztranslate/ztranslate.php');
152
- }
153
- add_action('admin_notices', 'qtranxf_admin_notices_plugin_conflicts');
154
-
155
- function qtranxf_admin_notice_plugin_integration($plugin,$integr_title,$integr_plugin)
156
- {
157
- if(!is_plugin_active($plugin)) return 0;
158
- if(is_plugin_active($integr_plugin)) return 0;
159
-
160
- $integr_slug = dirname($integr_plugin);
161
- $messages = get_option('qtranslate_admin_notices');
162
- if(isset($messages['integration-'.$integr_slug])) return 0;
163
-
164
- //$plugin_file = WP_PLUGIN_DIR.'/'.$plugin;
165
- $plugin_file = WP_CONTENT_DIR.'/plugins/'.$plugin;
166
- if(!file_exists($plugin_file)) return 0;
167
- $pd = get_plugin_data( $plugin_file, false, true );
168
- $pluginName = $pd['Name'];
169
- $pluginURI = $pd['PluginURI'];
170
-
171
- $me='<a href="https://wordpress.org/plugins/qtranslate-x/" style="color:blue" target="_blank">qTranslate&#8209;X</a>';
172
- $plugin_link='<a href="'.$pluginURI.'/" style="color:blue" target="_blank">'.$pluginName.'</a>';
173
- $integr_link='<a href="https://wordpress.org/plugins/'.$integr_slug.'/" style="color:magenta" target="_blank">'.$integr_title.'</a>';
174
-
175
- echo '<div class="update-nag" id="qtranxs-integration-'.$integr_slug.'"><p style="font-size: larger">';
176
- printf(__('Plugin %s may be integrated with multilingual plugin %s with a help of plugin %s.','qtranslate'),$plugin_link,$me,$integr_link);
177
- echo ' ';
178
- echo __('Please, press an appropriate button below.','qtranslate');
179
-
180
- $integr_file = WP_CONTENT_DIR.'/plugins/'.$integr_plugin;
181
- if(file_exists($integr_file)){
182
- echo '</p><p> &nbsp; &nbsp; &nbsp; &nbsp;<a class="button" href="'.esc_url( wp_nonce_url( admin_url('plugins.php?action=activate&plugin='.urlencode($integr_plugin)), 'activate-plugin_'.$integr_plugin)).'"><strong>'.sprintf(__('Activate plugin %s', 'qtranslate'), '<span style="color:magenta">'.$integr_title.'</span>').'</strong></a>';
183
- }else{
184
- echo '</p><p> &nbsp; &nbsp; &nbsp; &nbsp;<a class="button" href="'.esc_url( wp_nonce_url( admin_url('update.php?action=install-plugin&plugin='.urlencode($integr_slug)), 'install-plugin_'.$integr_slug)).'"><strong>'.sprintf(__('Install plugin %s', 'qtranslate'), '<span style="color:magenta">'.$integr_title.'</span>').'</strong></a>';
185
- }
186
- echo '&nbsp;&nbsp;&nbsp;<a class="button" href="javascript:qtranxj_dismiss_admin_notice(\'integration-'.$integr_slug.'\');">'.__('I am aware of that, dismiss this message.', 'qtranslate');
187
- echo '</a></p></div>';
188
- return 1;
189
- }
190
-
191
- function qtranxf_admin_notices_plugin_integration()
192
- {
193
- global $pagenow;
194
- if($pagenow == 'update.php') return;
195
- $cnt = 0;
196
-
197
- $cnt += qtranxf_admin_notice_plugin_integration('advanced-custom-fields/acf.php', 'ACF qTranslate', 'acf-qtranslate/acf-qtranslate.php');
198
-
199
- $cnt += qtranxf_admin_notice_plugin_integration('all-in-one-seo-pack/all_in_one_seo_pack.php', 'All in One SEO Pack & qTranslate&#8209;X', 'all-in-one-seo-pack-qtranslate-x/qaioseop.php');
200
-
201
- $cnt += qtranxf_admin_notice_plugin_integration('events-made-easy/events-manager.php', 'Events Made Easy & qTranslate&#8209;X', 'events-made-easy-qtranslate-x/events-made-easy-qtranslate-x.php');
202
-
203
- $cnt += qtranxf_admin_notice_plugin_integration('gravity-forms-addons/gravity-forms-addons.php', 'qTranslate support for GravityForms', 'qtranslate-support-for-gravityforms/qtranslate-support-for-gravityforms.php');
204
-
205
- $cnt += qtranxf_admin_notice_plugin_integration('woocommerce/woocommerce.php', 'WooCommerce & qTranslate&#8209;X', 'woocommerce-qtranslate-x/woocommerce-qtranslate-x.php');
206
-
207
- $cnt += qtranxf_admin_notice_plugin_integration('wordpress-seo/wp-seo.php', 'Wordpress SEO & qTranslate&#8209;X', 'wp-seo-qtranslate-x/wordpress-seo-qtranslate-x.php');
208
-
209
- if($cnt>0){
210
- ?>
211
- <script type="text/javascript">
212
- function qtranxj_dismiss_admin_notice(id) {
213
- jQuery('#qtranxs-'+id).css('display','none');
214
- jQuery.post(ajaxurl, { action: 'qtranslate_admin_notice', notice_id: id }
215
- //,function(response) { eval(response); }
216
- );
217
- }
218
- </script>
219
- <?php
220
- }
221
- }
222
- add_action('admin_notices', 'qtranxf_admin_notices_plugin_integration');
223
-
224
-
225
- function qtranxf_admin_notices_survey_request()
226
- {
227
- $messages = get_option('qtranslate_admin_notices');
228
- if(isset($messages['survey-translation-service'])) return;
229
- ?>
230
- <script type="text/javascript">
231
- function qtranxj_dismiss_admin_notice(id) {
232
- jQuery('#qtranxs-'+id).css('display','none');
233
- jQuery.post(ajaxurl, { action: 'qtranslate_admin_notice', notice_id: id }
234
- //,function(response) { eval(response); }
235
- );
236
- }
237
- </script>
238
- <?php
239
- echo '<div class="updated" id="qtranxs-survey-translation-service"><p style="font-size: larger;">';// text-align: center;
240
- printf(__('Thank you for using %s plugin!', 'qtranslate'), '<a href="https://wordpress.org/plugins/qtranslate-x/" style="color:blue" target="_blank">qTranslate&#8209;X</a>');
241
- echo '<br>';
242
- printf(__('Please, help us to make a decision on "%s" feature, press the button below.', 'qtranslate'), __('Translation Service', 'qtranslate'));
243
- echo '</p><p><a class="button" href="http://www.marius-siroen.com/qTranslate-X/TranslateServices/" target="_blank">';
244
- printf(__('Survey on "%s" feature', 'qtranslate'), __('Translation Service', 'qtranslate'));
245
- echo '</a>&nbsp;&nbsp;&nbsp;<a class="button" href="javascript:qtranxj_dismiss_admin_notice(\'survey-translation-service\');">'.__('I have already done it, dismiss this message.', 'qtranslate');
246
- echo '</a></p></div>';
247
- }
248
- add_action('admin_notices', 'qtranxf_admin_notices_survey_request');
249
-
250
-
251
- function qtranxf_ajax_qtranslate_admin_notice()
252
- {
253
- if(!isset($_POST['notice_id'])) return;
254
- $id = $_POST['notice_id'];
255
- $messages = get_option('qtranslate_admin_notices',array());
256
- $messages[$id] = time();
257
- update_option('qtranslate_admin_notices',$messages);
258
- //echo "jQuery('#qtranxs_+$id').css('display','none');"; die();
259
- }
260
- add_action('wp_ajax_qtranslate_admin_notice', 'qtranxf_ajax_qtranslate_admin_notice');
admin/css/opHighlightMode/Border_Around.css ADDED
@@ -0,0 +1,7 @@
1
+ /* Border Around */
2
+ input.qtranxs-translatable, textarea.qtranxs-translatable, div.qtranxs-translatable {
3
+ outline: 2px solid #Color2 !important;
4
+ }
5
+ div.qtranxs-translatable div.mce-panel {
6
+ margin-top: 2px
7
+ }
admin/css/opHighlightMode/Left_Border.css ADDED
@@ -0,0 +1,4 @@
1
+ /* Left Border */
2
+ input.qtranxs-translatable, textarea.qtranxs-translatable, div.qtranxs-translatable {
3
+ box-shadow: -3px 0 #Color2 !important;
4
+ }
admin/css/opLSBStyle/Simple_Buttons.css ADDED
@@ -0,0 +1,37 @@
1
+ /* Language Switching Buttons as Simple Horizontal Block */
2
+
3
+ .qtranxs-lang-switch-wrap
4
+ {
5
+ margin: 1px 0;
6
+ /* margin: 0; */
7
+ }
8
+
9
+ .qtranxs-lang-switch
10
+ {
11
+ border: 1px solid #ccc;
12
+ background-image: linear-gradient(to top,#e5e5e5,#f4f4f4);
13
+ /* margin-top: 2px; */
14
+ /* padding: 8px; */
15
+ padding: 0 0 2px 4px;
16
+ margin: 1px 4px 1px 0;
17
+ cursor: default;
18
+ display: inline-block;
19
+ }
20
+
21
+ .qtranxs-lang-switch.active
22
+ {
23
+ border-color: #888;
24
+ background-image: none;
25
+ background-color: #bbb;
26
+ color: #555;
27
+ }
28
+
29
+ .qtranxs-lang-switch>*
30
+ {
31
+ vertical-align: middle;
32
+ margin-right: 4px;
33
+ }
34
+
35
+ .qtranxs-lang-switch-wrap li.qtranxs-lang-switch:hover{
36
+ text-decoration: underline;
37
+ }
admin/css/opLSBStyle/Simple_Tabs.css ADDED
@@ -0,0 +1,52 @@
1
+ /* Language Switching Buttons as Simple Tabs */
2
+
3
+ .qtranxs-lang-switch-wrap {
4
+ margin: 10px 0 10px;
5
+ position: relative;
6
+ }
7
+
8
+ .qtranxs-lang-switch-wrap:before{
9
+ position: absolute;
10
+ content: ' ';
11
+ bottom:0;
12
+ left:0;
13
+ right:0;
14
+ z-index: 1;
15
+ border-bottom: 1px solid #ccc;
16
+ }
17
+
18
+ .qtranxs-lang-switch-wrap li.qtranxs-lang-switch{
19
+ position: relative;
20
+ border-color: #ccc;
21
+ padding: 5px 5px;
22
+ cursor: pointer;
23
+ position: relative;
24
+ z-index: 2;
25
+ background: none;
26
+ margin-right: 2px;
27
+ line-height: 1.42857143;
28
+ border: 1px solid transparent;
29
+ border-radius: 4px 4px 0 0;
30
+ opacity: 0.8;
31
+ display: inline-block;
32
+ }
33
+
34
+ .qtranxs-lang-switch-wrap li.qtranxs-lang-switch:hover{
35
+ background: #e0e0e0;
36
+ opacity: 1;
37
+ }
38
+
39
+ .qtranxs-lang-switch-wrap li.qtranxs-lang-switch.active,
40
+ .qtranxs-lang-switch-wrap li.qtranxs-lang-switch.active:focus,
41
+ .qtranxs-lang-switch-wrap li.qtranxs-lang-switch.active:hover {
42
+ color: #555;
43
+ cursor: default;
44
+ background-color: #f1f1f1;
45
+ border: 1px solid #ccc;
46
+ border-bottom-color: transparent;
47
+ opacity: 1;
48
+ }
49
+
50
+ .qtranxs-lang-switch img {
51
+ margin-right: 4px;
52
+ }
admin/css/opLSBStyle/Tabs_in_Block.css ADDED
@@ -0,0 +1,33 @@
1
+ /* Language Switching Buttons as Tabs in Black Block */
2
+
3
+ .qtranxs-lang-switch-wrap
4
+ {
5
+ margin: 0;
6
+ }
7
+
8
+ .qtranxs-lang-switch
9
+ {
10
+ padding: 3px 8px 5px 8px;
11
+ margin: 6px 4px 0 4px;
12
+ display: inline-block;
13
+ }
14
+
15
+ .qtranxs-lang-switch
16
+ {
17
+ cursor: pointer;
18
+ }
19
+
20
+ .qtranxs-lang-switch>*
21
+ {
22
+ vertical-align: middle;
23
+ margin-right: 4px;
24
+ }
25
+
26
+ .qtranxs-lang-switch *
27
+ {
28
+ vertical-align: middle;
29
+ }
30
+
31
+ .qtranxs-lang-switch img {
32
+ margin-right: 4px;
33
+ }
admin/css/qtranslate_configuration.css ADDED
@@ -0,0 +1,102 @@
1
+ /*
2
+ .qtranxs_title_input {
3
+ border:0pt none;
4
+ font-size:1.7em;
5
+ outline-color:invert;
6
+ outline-style:none;
7
+ outline-width:medium;
8
+ padding:0pt;
9
+ width:100%;
10
+ }
11
+ .qtranxs_title_wrap {
12
+ border-color:#CCCCCC;
13
+ border-style:solid;
14
+ border-width:1px;
15
+ padding:2px 3px;
16
+ }
17
+ #qtranxs_textarea_content {
18
+ padding:6px;
19
+ border:0 none;
20
+ line-height:150%;
21
+ outline: none;
22
+ margin:0pt;
23
+ width:100%;
24
+ -moz-box-sizing:
25
+ border-box;
26
+ -webkit-box-sizing: border-box;
27
+ -khtml-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ }
30
+ .qtranxs_title {
31
+ -moz-border-radius: 6px 6px 0 0;
32
+ -webkit-border-top-right-radius: 6px;
33
+ -webkit-border-top-left-radius: 6px;
34
+ -khtml-border-top-right-radius: 6px;
35
+ -khtml-border-top-left-radius: 6px;
36
+ border-top-right-radius: 6px;
37
+ border-top-left-radius: 6px;
38
+ }
39
+
40
+ .hide-if-no-js.wp-switch-editor.switch-tmce { margin-left:6px !important; }
41
+ #qtranxs_debug { width:100%; height:200px }
42
+ #postexcerpt textarea { height:4em; margin:0; width:98% }
43
+
44
+ .qtranxs_lang_div {
45
+ float:right;
46
+ height:12px;
47
+ width:18px;
48
+ padding:6px 5px 8px 5px;
49
+ cursor:pointer;
50
+ }
51
+ .qtranxs_lang_div.active {
52
+ background: #DFDFDF;
53
+ border-left:1px solid #D0D0D0;
54
+ border-right: 1px solid #F7F7F7;
55
+ padding:6px 4px 8px 4px;
56
+ }
57
+ #qtranxs_custom_fields { width:100%; }
58
+ */
59
+
60
+ /* Admin bar language menu */
61
+
62
+ #wpadminbar #wp-admin-bar-language>div.ab-item
63
+ {
64
+ padding-right: 30px;
65
+ cursor: default;
66
+ }
67
+ #wpadminbar #wp-admin-bar-language>div.ab-item,
68
+ #wpadminbar #wp-admin-bar-language ul li
69
+ {
70
+ background-repeat: no-repeat;
71
+ background-position: right;
72
+ background-size: 18px;
73
+ }
74
+
75
+ #wpadminbar li#wp-admin-bar-language { display: block; }
76
+
77
+
78
+ /* qTranslate-X configuration page */
79
+
80
+ #qtranxs-languages-menu img {
81
+ vertical-align: middle;
82
+ }
83
+ .qtranxs-language-list td
84
+ {
85
+ vertical-align: middle;
86
+ }
87
+
88
+ #qtranxs-enabled-languages tr td{
89
+ padding: 0px 5px 0px 0px;
90
+ }
91
+
92
+ /*
93
+ .form-table, .form-table td, .form-table td p, .form-table th, .form-wrap label
94
+ .qtranxs_notes, .form-table td p.qtranxs_notes{
95
+ */
96
+ .qtranxs_notes, .form-table td p.qtranxs_notes, .form-wrap p.qtranxs_notes{
97
+ font-size: smaller;
98
+ }
99
+
100
+ .qtranxs_option_group {
101
+ text-decoration: underline;
102
+ }
admin/i18n-interface-admin.php ADDED
@@ -0,0 +1,20 @@
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+
4
+ /**
5
+ * WP_Translator interface for admin side.
6
+ * See also documentation of interface WP_Translator in ./inc/i18n-interface.php
7
+ *
8
+ * @since 3.4
9
+ */
10
+ interface WP_Translator_Admin extends WP_Translator
11
+ {
12
+ /**
13
+ * Get an encoded multilingual value for a term name.
14
+ *
15
+ * @param (mixed) $term - The term name to be encoded or null. It may be object with property 'name', or array of names or objects.
16
+ * @param (mixed)(optional) $term_default - The default term name to be encoded or null. It may be an array of terms.
17
+ * @param (string)(optional) $taxonomy - Taxonomy name that $term is part of. Currently unused, since all term names assumed to be unique across all taxonomies.
18
+ */
19
+ public function multilingual_term($term, $term_default=null, $taxonomy=null);
20
+ }
admin/import_export.php DELETED
@@ -1,189 +0,0 @@
1
- <?php // encoding: utf-8
2
- /*
3
- Copyright 2014 qTranslate Team (email : qTranslateTeam@gmail.com )
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation; either version 2 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program; if not, write to the Free Software
17
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
- */
19
-
20
- function qtranxf_get_plugin_name($slug)
21
- {
22
- //there must be a better way to take it from file?
23
- switch($slug) {
24
- case 'qtranslate': return 'qTranslate';
25
- case 'mqtranslate': return 'mqTranslate';
26
- case 'qtranslate-xp': return 'qTranslate Plus';
27
- case 'ztranslate': return 'zTranslate';
28
- case 'sitepress-multilingual-cms': return 'WPML';
29
- default: return '';
30
- }
31
- }
32
-
33
- function qtranxf_migrate_options_update($nm_to,$nm_from)
34
- {
35
- global $wpdb;
36
- $option_names = $wpdb->get_col("SELECT `option_name` FROM {$wpdb->options} WHERE `option_name` LIKE '$nm_to\_%'");
37
- foreach ($option_names as $name)
38
- {
39
- if(strpos($name,'_flag_location')>0) continue;
40
- $nm = str_replace($nm_to,$nm_from,$name);
41
- $value=get_option($nm);
42
- if($value===FALSE) continue;
43
- update_option($name,$value);
44
- }
45
- }
46
-
47
- function qtranxf_migrate_options_copy($nm_to,$nm_from)
48
- {
49
- global $wpdb;
50
- $options = $wpdb->get_results("SELECT option_name, option_value FROM {$wpdb->options} WHERE `option_name` LIKE '$nm_from\_%'");
51
- foreach ($options as $option)
52
- {
53
- $name = $option->option_name;
54
- //skip new qTranslate-X specific options
55
- switch($name){
56
- case 'qtranslate_flag_location':
57
- case 'qtranslate_admin_notices':
58
- case 'qtranslate_domains':
59
- case 'qtranslate_editor_mode':
60
- case 'qtranslate_custom_fields':
61
- case 'qtranslate_custom_field_classes':
62
- case 'qtranslate_text_field_filters':
63
- case 'qtranslate_qtrans_compatibility':
64
- case 'qtranslate_header_css_on':
65
- case 'qtranslate_header_css':
66
- case 'qtranslate_filter_options_mode':
67
- case 'qtranslate_filter_options':
68
- continue;
69
- default: break;
70
- }
71
- //if(strpos($name,'_flag_location')>0) continue;
72
- $value = maybe_unserialize($option->option_value);
73
- if(strpos($name,'_flag_location')>0) continue;
74
- $nm = str_replace($nm_from,$nm_to,$name);
75
- update_option($nm,$value);
76
- }
77
- }
78
-
79
- function qtranxf_migrate_import_mqtranslate(){
80
- qtranxf_migrate_options_update('qtranslate','mqtranslate');
81
- update_option('qtranslate_qtrans_compatibility', '1');//since 3.1
82
- }
83
- function qtranxf_migrate_export_mqtranslate(){ qtranxf_migrate_options_copy('mqtranslate','qtranslate'); }
84
-
85
- function qtranxf_migrate_import_qtranslate_xp(){ qtranxf_migrate_options_update('qtranslate','ppqtranslate'); }
86
- function qtranxf_migrate_export_qtranslate_xp(){ qtranxf_migrate_options_copy('ppqtranslate','qtranslate'); }
87
-
88
- //function qtranxf_migrate_import_ztranslate(){ qtranxf_migrate_options_update('qtranslate','ztranslate'); }
89
- //function qtranxf_migrate_export_ztranslate(){ qtranxf_migrate_options_copy('ztranslate','qtranslate'); }
90
-
91
- function qtranxf_migrate_plugin($plugin){
92
- $var=$plugin.'-migration';
93
- if(!isset($_POST[$var])) return;
94
- $action = $_POST[$var];
95
- if($action=='none') return;
96
- $f='qtranxf_migrate_'.$_POST[$var].'_'.str_replace('-','_',$plugin);
97
- $f();
98
- if( $action == 'export' ) return;
99
- //if( $plugin == 'mqtranslate' )//since 3.2-b2: moved to qtranxf_migrate_import_mqtranslate
100
- // update_option('qtranslate_qtrans_compatibility', '1');
101
- qtranxf_reloadConfig();
102
- }
103
-
104
- function qtranxf_migrate_plugins()
105
- {
106
- if(!current_user_can('manage_options')) return;
107
- qtranxf_migrate_plugin('mqtranslate');
108
- qtranxf_migrate_plugin('qtranslate-xp');
109
- //qtranxf_migrate_plugin('ztranslate');//ok same db
110
- }
111
- add_action('qtranslate_saveConfig','qtranxf_migrate_plugins',30);
112
- //add_action('qtranslate_init_begin','qtranxf_migrate_plugins',11);
113
-
114
- function qtranxf_add_row_migrate($nm,$plugin) {
115
- $plugin_file = WP_CONTENT_DIR.'/plugins/'.$plugin;
116
- if(!file_exists($plugin_file)) return;
117
- //$pd = get_plugin_data( $plugin_file.'/mqtranslate.php', false, true );
118
- //qtranxf_dbg_log('qtranxf_add_row_migrate: $pd:',$pd);
119
- switch($plugin){
120
- case 'sitepress-multilingual-cms': $href='https://wpml.org'; break;
121
- default: $href='https://wordpress.org/plugins/'.$plugin; break;
122
- }
123
- ?>
124
- <tr valign="top" id="qtranslate-<?php echo $plugin; ?>">
125
- <th scope="row"><?php _e('Plugin');?> <a href="<?php echo $href; ?>/" target="_blank"><?php echo $nm; ?></a></th>
126
- <td>
127
- <?php
128
- switch($plugin){
129
- case 'qtranslate':
130
- case 'ztranslate':
131
- _e('There is no need to migrate any setting, the database schema is compatible with this plugin.', 'qtranslate');
132
- break;
133
- case 'sitepress-multilingual-cms':
134
- printf(__('Use plugin %s to import data.', 'qtranslate'),'<a href="https://wordpress.org/plugins/w2q-wpml-to-qtranslate/" target="_blank">W2Q: WPML to qTranslate</a>');
135
- break;
136
- default:
137
- ?>
138
- <label for="<?php echo $plugin; ?>_no_migration"><input type="radio" name="<?php echo $plugin; ?>-migration" id="<?php echo $plugin; ?>_no_migration" value="none" checked /> <?php _e('Do not migrate any setting', 'qtranslate'); ?></label>
139
- <br/>
140
- <label for="<?php echo $plugin; ?>_import_migration"><input type="radio" name="<?php echo $plugin; ?>-migration" id="<?php echo $plugin; ?>_import_migration" value="import" /> <?php echo __('Import settings from ', 'qtranslate').$nm; ?></label>
141
- <br/>
142
- <label for="<?php echo $plugin; ?>_export_migration"><input type="radio" name="<?php echo $plugin; ?>-migration" id="<?php echo $plugin; ?>_export_migration" value="export" /> <?php echo __('Export settings to ', 'qtranslate').$nm; ?></label>
143
- <?php break; } ?>
144
- </td>
145
- </tr>
146
- <?php
147
- }
148
-
149
- function qtranxf_admin_section_import_export($request_uri)
150
- {
151
- qtranxf_admin_section_start(__('Import', 'qtranslate').'/'.__('Export', 'qtranslate'),'import');
152
- //id="qtranslate-admin-import" style="display: none"
153
- ?>
154
- <table class="form-table">
155
- <tr valign="top" id="qtranslate-convert-database">
156
- <th scope="row"><?php _e('Convert Database', 'qtranslate');?></th>
157
- <td>
158
- <?php printf(__('If you are updating from qTranslate 1.x or Polyglot, <a href="%s">click here</a> to convert posts to the new language tag format.', 'qtranslate'), $request_uri.'&convert=true'); ?>
159
- <?php printf(__('If you have installed qTranslate for the first time on a Wordpress with existing posts, you can either go through all your posts manually and save them in the correct language or <a href="%s">click here</a> to mark all existing posts as written in the default language.', 'qtranslate'), $request_uri.'&markdefault=true'); ?>
160
- <?php _e('Both processes are <b>irreversible</b>! Be sure to make a full database backup before clicking one of the links.', 'qtranslate'); ?><br/><br/>
161
- <label for="qtranxs_convert_database_none"><input type="radio" name="convert_database" id="qtranxs_convert_database_none" value="none" checked />&nbsp;<?php _e('Do not convert database', 'qtranslate'); ?></label><br/><br/>
162
- <label for="qtranxs_convert_database_to_b_only"><input type="radio" name="convert_database" id="qtranxs_convert_database_to_b_only" value="b_only" />&nbsp;<?php echo __('Convert database to the "square bracket only" style.', 'qtranslate'); ?></label><br/>
163
- <small><?php printf(__('The square bracket language tag %s only will be used as opposite to dual-tag (%s and %s) %s legacy database format. All string options and standard post and page fields will be uniformly encoded like %s.','qtranslate'),'[:]',esc_html('<!--:-->'),'[:]','qTranslate','"[:en]English[:de]Deutsch[:]"'); ?></small><br/><br/>
164
- <label for="qtranxs_convert_database_to_c_dual"><input type="radio" name="convert_database" id="qtranxs_convert_database_to_c_dual" value="c_dual" />&nbsp;<?php echo __('Convert database back to the legacy "dual language tag" style.', 'qtranslate'); ?></label><br/>
165
- <small><?php _e('Note, that only string options and standard post and page fields are affected.','qtranslate'); ?></small>
166
- </td>
167
- </tr>
168
- <?php qtranxf_add_row_migrate('qTranslate','qtranslate'); ?>
169
- <?php qtranxf_add_row_migrate('mqTranslate','mqtranslate'); ?>
170
- <?php qtranxf_add_row_migrate('qTranslate Plus','qtranslate-xp'); ?>
171
- <?php qtranxf_add_row_migrate('zTranslate','ztranslate'); ?>
172
- <?php qtranxf_add_row_migrate('WPML Multilingual CMS','sitepress-multilingual-cms'); ?>
173
- <tr valign="top">
174
- <th scope="row"><?php _e('Reset qTranslate', 'qtranslate');?></th>
175
- <td>
176
- <label for="qtranslate_reset"><input type="checkbox" name="qtranslate_reset" id="qtranslate_reset" value="1"/> <?php _e('Check this box and click Save Changes to reset all qTranslate settings.', 'qtranslate'); ?></label>
177
- <br/>
178
- <label for="qtranslate_reset2"><input type="checkbox" name="qtranslate_reset2" id="qtranslate_reset2" value="1"/> <?php _e('Yes, I really want to reset qTranslate.', 'qtranslate'); ?></label>
179
- <br/>
180
- <label for="qtranslate_reset3"><input type="checkbox" name="qtranslate_reset3" id="qtranslate_reset3" value="1"/> <?php _e('Also delete Translations for Categories/Tags/Link Categories.', 'qtranslate'); ?></label>
181
- <br/>
182
- <small><?php _e('If something isn\'t working correctly, you can always try to reset all qTranslate settings. A Reset won\'t delete any posts but will remove all settings (including all languages added).', 'qtranslate'); ?></small>
183
- </td>
184
- </tr>
185
- </table>
186
- <?php
187
- qtranxf_admin_section_end('import');
188
- }
189
- add_action('qtranslate_configuration', 'qtranxf_admin_section_import_export', 9);
admin/js/common.js CHANGED
@@ -1,3 +1,29 @@
1
/*
2
// debugging tools, do not check in
3
var cc=0;
@@ -11,8 +37,7 @@ function co(t,o){ ++cc; console.log('== '+cc+': '+t+'%o',o); }
11
*/
12
qtranxj_get_split_blocks = function(text)
13
{
14
- //var split_regex = /(<!--:[a-z]{2}-->|<!--:-->|\[:[a-z]{2}\]|\[:\]|\{:[a-z]{2}\}|\{:\})/gi;
15
- var split_regex = /(<!--:[a-z]{2}-->|<!--:-->|\[:[a-z]{2}\]|\[:\])/gi;
16
return text.xsplit(split_regex);
17
}
18
@@ -31,30 +56,31 @@ qtranxj_split = function(text)
31
qtranxj_split_blocks = function(blocks)
32
{
33
var result = new Object;
34
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i)
35
{
36
- var lang=qTranslateConfig.enabled_languages[i];
37
result[lang] = '';
38
}
39
//if(!qtranxj_isArray(blocks))//since 3.2.7
40
if(!blocks || !blocks.length)
41
return result;
42
- if(blocks.length==1){//no language separator found, enter it to all languages
43
var b=blocks[0];
44
- for(var j=0; j<qTranslateConfig.enabled_languages.length; ++j){
45
- var lang=qTranslateConfig.enabled_languages[j];
46
result[lang] += b;
47
}
48
return result;
49
}
50
var clang_regex=/<!--:([a-z]{2})-->/gi;
51
var blang_regex=/\[:([a-z]{2})\]/gi;
52
- //var slang_regex=/\{:([a-z]{2})\}/gi; //maybe later we will need it?
53
var lang = false;
54
var matches;
55
for(var i = 0;i<blocks.length;++i){
56
var b=blocks[i];
57
- //c('blocks['+i+']='+b);
58
if(!b.length) continue;
59
matches = clang_regex.exec(b); clang_regex.lastIndex=0;
60
if(matches!=null){
@@ -66,19 +92,20 @@ qtranxj_split_blocks = function(blocks)
66
lang = matches[1];
67
continue;
68
}
69
- //matches = slang_regex.exec(b); slang_regex.lastIndex=0;
70
- //if(matches!=null){
71
- // lang = matches[1];
72
- // continue;
73
- //}
74
- if( b == '<!--:-->' || b == '[:]' ){// || b == '{:}' ){
75
lang = false;
76
continue;
77
}
78
if(lang){
79
- result[lang] += b;
80
lang = false;
81
- }else{//keep neutral text
82
for(var key in result){
83
result[key] += b;
84
}
@@ -87,123 +114,6 @@ qtranxj_split_blocks = function(blocks)
87
return result;
88
}
89
90
- qtranxj_allthesame = function(texts)
91
- {
92
- if(qTranslateConfig.enabled_languages.length==0) return '';
93
- var text = '';
94
- //take first not empty
95
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i)
96
- {
97
- var lang=qTranslateConfig.enabled_languages[i];
98
- var t = texts[lang];
99
- if ( !t || t=='' ) continue;
100
- text = t;
101
- break;
102
- }
103
- if ( text=='' ) return text;
104
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i)
105
- {
106
- var lang=qTranslateConfig.enabled_languages[i];
107
- var t = texts[lang];
108
- if ( t == text ) continue;
109
- return null;
110
- }
111
- return text;
112
- }
113
-
114
- /**
115
- * "_c" stands for "comment"
116
- * since 3.1-b1 - no _c any more
117
- */
118
- qtranxj_join_c = function(texts)
119
- {
120
- return qtranxj_join_b(texts);
121
- /*
122
- var text = qtranxj_allthesame(texts);
123
- if(text!=null) return text;
124
- text='';
125
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i)
126
- {
127
- var lang=qTranslateConfig.enabled_languages[i];
128
- var t = texts[lang];
129
- if ( !t || t=='' ) continue;
130
- text += '<!--:'+lang+'-->';
131
- text += t;
132
- text += '<!--:-->';
133
- }
134
- //c('qtranxj_join_c:text:'+text);
135
- return text;
136
- */
137
- }
138
-
139
- //"b" stands for "bracket"
140
- qtranxj_join_b = function(texts)
141
- {
142
- var text = qtranxj_allthesame(texts);
143
- if(text!=null) return text;
144
- var text = '';
145
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i)
146
- {
147
- var lang=qTranslateConfig.enabled_languages[i];
148
- var t = texts[lang];
149
- if ( !t || t=='' ) continue;
150
- text += '[:'+lang+']';
151
- text += t;
152
- }
153
- if( text != '' ) text += '[:]';
154
- return text;
155
- }
156
-
157
- /*
158
- * "s" stands for 'squiggly bracket'
159
- * Introduced, because some plugins, like [WordPress SEO](https://wordpress.org/plugins/wordpress-seo/),
160
- * remove '[:]' treating them as shortcodes.
161
- * since 3.2.7
162
- *
163
- qtranxj_join_s = function(texts)
164
- {
165
- var text = qtranxj_allthesame(texts);
166
- if(text!=null) return text;
167
- var text = '';
168
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i)
169
- {
170
- var lang=qTranslateConfig.enabled_languages[i];
171
- var t = texts[lang];
172
- if ( !t || t=='' ) continue;
173
- text += '{:'+lang+'}';
174
- text += t;
175
- }
176
- if( text != '' ) text += '{:}';
177
- return text;
178
- }
179
- */
180
-
181
- /**
182
- * since 3.1-b1
183
- */
184
- qtranxj_join_byline = function(texts)
185
- {
186
- var text = qtranxj_allthesame(texts);
187
- if(text!=null) return text;
188
- var lines;
189
- for(var lang in texts){
190
- texts[lang] = texts[lang].split('\n');
191
- }
192
- var text = '';
193
- for(var i=0; true; ++i){
194
- var ln;
195
- for(var lang in texts){
196
- if ( texts[lang].length() <= i ) continue;
197
- var t = texts[lang][i];
198
- if ( !t || t=='' ) continue;
199
- ln[lang] = t;
200
- }
201
- if( !ln ) break;
202
- text += qtranxj_join_b(ln);
203
- }
204
- return text;
205
- }
206
-
207
function qtranxj_get_cookie(cname)
208
{
209
var nm = cname + "=";
@@ -275,88 +185,197 @@ function qtranxj_ce(tagName, props, pNode, isFirst)
275
276
var qTranslateX=function(pg)
277
{
278
- this.ge=function(id){ return document.getElementById(id); }
279
280
- isLanguageEnabled=function(lang)
281
- {
282
- for(var i=0; i<qTranslateConfig.enabled_languages.length; ++i){
283
- if(qTranslateConfig.enabled_languages[i]==lang) return true;
284
- }
285
- return false;
286
- }
287
288
- qTranslateConfig.activeLanguage = qtranxj_get_cookie('qtrans_edit_language');
289
- if(!qTranslateConfig.activeLanguage || !isLanguageEnabled(qTranslateConfig.activeLanguage))
290
- qTranslateConfig.activeLanguage = qTranslateConfig.language;
291
292
- this.getActiveLanguage=function() { return qTranslateConfig.activeLanguage; }
293
294
- var contentHooks={};
295
296
- updateFusedValueHooked=function(h)
297
- {
298
- switch(h.separator){
299
- case '<': h.mlContentField.value = qtranxj_join_c(h.contents); break;
300
- case 'byline': h.mlContentField.value = qtranxj_join_byline(h.contents); break;
301
- case '[':
302
- default: h.mlContentField.value = qtranxj_join_b(h.contents); break;
303
- }
304
- /*
305
- if(h.separator==='<'){
306
- h.mlContentField.value = qtranxj_join_c(h.contents);
307
- }else{
308
- h.mlContentField.value = qtranxj_join_b(h.contents);
309
}
310
- */
311
- //c('updateFusedValueHooked['+h.mce.id+'] text:'+h.mlContentField.value);
312
}
313
314
- updateFusedValueH=function(id,value)
315
{
316
- var h=contentHooks[id];
317
- var text=value.trim();
318
//c('updateFusedValueH['+id+'] lang='+h.lang+'; text:'+text);
319
- h.contents[h.lang]=text;
320
- updateFusedValueHooked(h);
321
}
322
323
- addContentHook=function(inpField,form,separator)
324
{
325
//co('addContentHook: inpField:',inpField);
326
if( !inpField ) return false;
327
- if( !inpField.name ) return false;
328
- //if( typeof inpField.value !== 'string' ) return false;
329
switch(inpField.tagName){
330
- case 'TEXTAREA':
331
- case 'INPUT': break;
332
default: return false;
333
}
334
- if(!inpField.id){
335
- inpField.id = inpField.tagName;
336
- if(form.id) inpField.id += form.id;
337
- if(inpField.name) inpField.id += inpField.name;
338
}
339
- if(contentHooks[inpField.id]) return true;
340
- var h=contentHooks[inpField.id]={};
341
- //h.id=inpField.id;
342
h.contentField=inpField;
343
//c('addContentHook: inpField.value='+inpField.value);
344
- h.contents=qtranxj_split(inpField.value);//keep neutral text from older times, just in case.
345
//inpField.tagName
346
- h.mlContentField=qtranxj_ce('input', {name: inpField.name, type: 'hidden', className: 'hidden', value: inpField.value}, form);
347
- if(!separator){
348
- if(inpField.tagName==='TEXTAREA')
349
- separator='<';
350
- else
351
- separator='[';//since 3.1 we get rid of <:> encoding
352
- }
353
- h.separator=separator;
354
- inpField.name='edit-'+inpField.name;
355
- h.lang=qTranslateConfig.activeLanguage;
356
- var text = h.contents[h.lang];
357
- inpField.value=text;
358
- //c('addContentHook['+inpField.id+']['+h.lang+']: inpField.value='+inpField.value);
359
- inpField.onblur=function(){ updateFusedValueH(this.id,this.value); }
360
361
/**
362
* Highlighting the translatable fields
@@ -364,57 +383,149 @@ var qTranslateX=function(pg)
364
*/
365
inpField.className += ' qtranxs-translatable';
366
367
- if(window.tinyMCE){//never fired yet
368
for(var i=0; i<tinyMCE.editors.length; ++i){
369
var ed=tinyMCE.editors[i];
370
if(ed.id != inpField.id) continue;
371
- //c('addContentHook:updateTinyMCE');
372
h.mce=ed;
373
- updateTinyMCE(ed,text);
374
}
375
}
376
return h;
377
}
378
- this.addContentHookC=function(inpField,form) { return addContentHook(inpField,form,'<'); }
379
- this.addContentHookB=function(inpField,form) { return addContentHook(inpField,form,'['); }
380
381
- this.addContentHookById=function(id,form,sep) { return addContentHook(this.ge(id),form,sep); }
382
- this.addContentHookByIdName=function(nm,form)
383
{
384
var sep;
385
if(nm.indexOf('<')==0 || nm.indexOf('[')==0){
386
sep=nm.substring(0,1);
387
nm=nm.substring(1);
388
}
389
- return this.addContentHookById(nm,form,sep);
390
}
391
- this.addContentHookByIdC=function(id,form) { return this.addContentHookById(id,form,'<'); }
392
- this.addContentHookByIdB=function(id,form) { return this.addContentHookById(id,form,'['); }
393
394
this.removeContentHook=function(inpField)
395
{
396
if( !inpField ) return false;
397
if( !inpField.id ) return false;
398
if( !contentHooks[inpField.id] ) return false;
399
var h=contentHooks[inpField.id];
400
inpField.onblur = function(){};
401
inpField.name=inpField.name.replace(/^edit-/,'');
402
inpField.value=h.mlContentField.value;
403
- jQuery(inpField).removeClass('qtranxs-translatable');
404
jQuery(h.mlContentField).remove();
405
- delete contentHooks[inpField.id];
406
return true;
407
};
408
409
/**
410
* @since 3.2.7
411
*/
412
var displayHookNodes=[];
413
- addDisplayHookNode=function(nd)
414
{
415
if(!nd.nodeValue) return 0;
416
var blocks = qtranxj_get_split_blocks(nd.nodeValue);
417
if( !blocks || !blocks.length || blocks.length == 1 ) return 0;
418
var h={};
419
h.nd=nd;
420
//co('addDisplayHookNode: nd=',nd);
@@ -427,167 +538,169 @@ var qTranslateX=function(pg)
427
}
428
429
/**
430
* @since 3.2.7 switched to use of nodeValue instead of innerHTML.
431
*/
432
- addDisplayHook=function(elem)
433
{
434
- //co('addDisplayHook: elem=',elem);
435
if(!elem || !elem.tagName) return 0;
436
switch(elem.tagName){
437
- case 'TEXTAREA':
438
- case 'INPUT': return 0;
439
default: break;
440
}
441
var cnt = 0;
442
if(elem.childNodes && elem.childNodes.length){
443
for(var i = 0; i < elem.childNodes.length; ++i){
444
var nd = elem.childNodes[i];
445
switch(nd.nodeType){//http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1950641247
446
case 1://ELEMENT_NODE
447
- cnt += addDisplayHook(nd);//recursive call
448
break;
449
case 2://ATTRIBUTE_NODE
450
- //co('addDisplayHook: ATTRIBUTE_NODE: ',nd);
451
case 3://TEXT_NODE
452
cnt += addDisplayHookNode(nd);
453
break;
454
- default: break;
455
- }
456
- }
457
- }
458
- return cnt;
459
- }
460
-
461
- /*
462
- var displayHooks=[];
463
- addDisplayHook=function(elem)
464
- {
465
- //co('addDisplayHook: elem=',elem);
466
- if(!elem || !elem.tagName) return 0;
467
- switch(elem.tagName){
468
- case 'TEXTAREA':
469
- case 'INPUT': return 0;
470
- default: break;
471
- }
472
- var cnt = 0;
473
- if(elem.innerHTML){
474
- var h={};
475
- h.elem=elem;
476
- var content = elem.innerHTML.replace(/&lt;!--:([a-z]{2}|)--&gt;/gi,'<!--:$1-->');//un-escape language HTML
477
- var blocks = qtranxj_get_split_blocks(content);
478
- if( blocks && blocks.length && blocks.length > 1 ){
479
- //co('addDisplayHook: elem=',elem);
480
- //c('addDisplayHook: innerHTML='+elem.innerHTML);
481
- //c('addDisplayHook: outterHTML='+elem.outerHTML);
482
- //c('addDisplayHook: textContent='+elem.textContent);
483
- //c('addDisplayHook: nodeValue='+elem.nodeValue);
484
- //c('addDisplayHook: content='+content);
485
- h.contents = qtranxj_split_blocks(blocks);
486
- //h.contents = qtranxj_split(content);
487
- elem.innerHTML=h.contents[qTranslateConfig.activeLanguage];
488
- if(elem.value){
489
- var value = elem.value.replace(/&lt;!--:([a-z]{2}|)--&gt;/gi,'<!--:$1-->');//un-escape language HTML
490
- if(value != ''){
491
- //h.values=qtranxj_split(value);
492
- var blocks = qtranxj_get_split_blocks(value);
493
- if( blocks && blocks.length && blocks.length > 1){
494
- h.values = qtranxj_split_blocks(blocks);
495
- elem.value = h.values[qTranslateConfig.activeLanguage];
496
- }
497
- }
498
}
499
- displayHooks.push(h);
500
- cnt = 1;
501
- }
502
- }
503
- if(elem.children && elem.children.length){
504
- for(var i = 0; i < elem.children.length; ++i){
505
- var nd = elem.children[i];
506
- //c('addDisplayHook: nodeType='+nd.nodeType+'; nodeName='+nd.nodeName+'; nodeValue='+nd.nodeValue);
507
- cnt += addDisplayHook(nd);//recursive call
508
}
509
}
510
return cnt;
511
}
512
- */
513
- this.addDisplayHookById=function(id) { return addDisplayHook(this.ge(id)); }
514
515
- setLangCookie=function(lang) { document.cookie='qtrans_edit_language='+lang; }
516
517
- updateTinyMCE=function(ed,text)
518
{
519
//c('updateTinyMCE: text:'+text);
520
- if(window.switchEditors){
521
//text = window.switchEditors.pre_wpautop( text );
522
text = window.switchEditors.wpautop(text);
523
//c('updateTinyMCE:wpautop:'+text);
524
}
525
- ed.setContent(text,{format: 'html'});
526
}
527
528
- onTabSwitch=function()
529
{
530
- setLangCookie(this.lang);
531
- /*
532
- for(var i=0; i<displayHooks.length; ++i){
533
- var h=displayHooks[i];
534
- h.elem.innerHTML=h.contents[this.lang];
535
- if(h.values)
536
- h.elem.value=h.values[this.lang];
537
- }*/
538
- for(var i=0; i<displayHookNodes.length; ++i){
539
var h=displayHookNodes[i];
540
- h.nd.nodeValue = h.contents[this.lang];
541
}
542
for(var key in contentHooks){
543
var h=contentHooks[key];
544
var mce = h.mce && !h.mce.hidden;
545
if(mce){
546
- //c('onTabSwitch: h['+key+'].contentField.value before save:'+h.contentField.value);
547
h.mce.save({format: 'html'});
548
- h.contents[h.lang] = h.contentField.value;
549
}
550
- h.lang = this.lang;
551
- var value = h.contents[this.lang];
552
if(h.contentField.placeholder && value != ''){//since 3.2.7
553
h.contentField.placeholder='';
554
}
555
h.contentField.value = value;
556
- //c('onTabSwitch: h['+key+'].contentField.value:'+h.contentField.value);
557
if(mce){
558
- updateTinyMCE(h.mce,h.contentField.value);
559
}
560
}
561
}
562
563
- qTranslateConfig.qtx = this;
564
onTabSwitchCustom=function()
565
{
566
//co('onTabSwitch: this',this);
567
//co('onTabSwitch: qtx',qTranslateConfig.qtx);
568
pg.onTabSwitch(this.lang,qTranslateConfig.qtx);
569
}
570
571
- addDisplayHooks=function(elems)
572
{
573
//c('addDisplayHooks: elems.length='+elems.length);
574
for(var i=0; i<elems.length; ++i){
575
var e=elems[i];
576
//co('addDisplayHooks: e=',e);
577
//co('addDisplayHooks: e.tagName=',e.tagName);
578
- addDisplayHook(e);
579
}
580
}
581
582
this.addDisplayHooksByClass=function(nm,container)
583
{
584
//co('addDisplayHooksByClass: container:',container);
585
var elems=container.getElementsByClassName(nm);
586
//co('addDisplayHooksByClass: elems('+nm+'):',elems);
587
//co('addDisplayHooksByClass: elems.length=',elems.length);
588
- addDisplayHooks(elems);
589
}
590
591
this.addDisplayHooksByTagInClass=function(nm,tag,container)
592
{
593
var elems=container.getElementsByClassName(nm);
@@ -595,77 +708,83 @@ var qTranslateX=function(pg)
595
for(var i=0; i<elems.length; ++i){
596
var elem=elems[i];
597
var items=elem.getElementsByTagName(tag);
598
- addDisplayHooks(items);
599
- }
600
- }
601
-
602
- /**
603
- * @since 3.1-b2
604
- */
605
- addContentFieldHooks=function(fields,form,sep)
606
- {
607
- for(var i=0; i<fields.length; ++i){
608
- var f=fields[i];
609
- //if(sep=='[') //co('addContentHooksByClass: f: ',f);
610
- addContentHook(f,form,sep);
611
}
612
}
613
614
- addContentHooksByClassName=function(nm,form,container,sep)
615
- {
616
- if(!container) container=form;
617
- var fields=container.getElementsByClassName(nm);
618
- //if(sep=='[') //c('addContentHooksByClass: fields.length='+fields.length);
619
- addContentFieldHooks(fields,form,sep);
620
- }
621
-
622
- this.addContentHooksByClass=function(nm,form,container)
623
- {
624
- var sep;
625
- if(nm.indexOf('<')==0 || nm.indexOf('[')==0){
626
- sep=nm.substring(0,1);
627
- nm=nm.substring(1);
628
- }
629
- addContentHooksByClassName(nm,form,container,sep);
630
- }
631
632
/**
633
* adds custom hooks from configuration
634
* @since 3.1-b2 - renamed to addCustomContentHooks, since addContentHooks used in qTranslateConfig.js
635
* @since 3.0 - addContentHooks
636
*/
637
- this.addCustomContentHooks=function(form)
638
{
639
//c('qTranslateConfig.custom_fields.length='+qTranslateConfig.custom_fields.length);
640
for(var i=0; i<qTranslateConfig.custom_fields.length; ++i){
641
var nm=qTranslateConfig.custom_fields[i];
642
- this.addContentHookByIdName(nm,form);
643
}
644
for(var i=0; i<qTranslateConfig.custom_field_classes.length; ++i){
645
var nm=qTranslateConfig.custom_field_classes[i];
646
- this.addContentHooksByClass(nm,form);
647
}
648
}
649
650
/**
651
- * Parses custom page configuration, loaded in qtranxf_load_admin_page_config.
652
* @since 3.1-b2
653
*/
654
- this.addPageHooks=function(page_config_forms)
655
{
656
- for(var p=0; p < page_config_forms.length; ++p){
657
- var frm = page_config_forms[p];
658
var form;
659
if(frm.form){
660
- form = document.getElementById(frm.form.id);
661
}else{
662
- form = this.getWrapForm();
663
}
664
//co('form=',form);
665
//c('frm.fields.length='+frm.fields.length);
666
- for(var f=0; f < frm.fields.length; ++f){
667
- var fld = frm.fields[f];
668
- //co('fld=',fld);
669
//c('encode='+fld.encode);
670
//c('id='+fld.id);
671
//c('class='+fld.class);
@@ -673,72 +792,50 @@ var qTranslateX=function(pg)
673
if(fld.container_id){
674
var container = document.getElementById(fld.container_id);
675
if(container) containers.push(container);
676
}else if(fld.container_class){
677
containers = document.getElementsByClassName(fld.container_class);
678
- }else if(form){
679
containers.push(form);
680
}
681
var sep = fld.encode;
682
switch( sep ){
683
case 'display':
684
- if(fld.id) addDisplayHook(document.getElementById(fld.id));
685
- else if(fld.class){
686
- //c('addPageHooks: display: class='+fld.class+'; fld.tag='+fld.tag);
687
- //c('class='+fld.class+'; containers.length='+containers.length);
688
- for(var i=0; i < containers.length; ++i){
689
- var container = containers[i];
690
- var fields=container.getElementsByClassName(fld.class);
691
- for(var j=0; j<fields.length; ++j){
692
- var field=fields[j];
693
- //c('field.tagName='+field.tagName);
694
- if(fld.tag && fld.tag != field.tagName) continue;
695
- addDisplayHook(field);
696
- }
697
- //this.addDisplayHooksByClass(fld.class,container);
698
- }
699
- }else if(fld.tag){
700
- //c('tag='+fld.tag+'; containers.length='+containers.length);
701
for(var i=0; i < containers.length; ++i){
702
var container = containers[i];
703
- //co('container=',container);
704
- var elems=container.getElementsByTagName(fld.tag);
705
- //co('elems=',elems);
706
- addDisplayHooks(elems);
707
}
708
}else{
709
- continue;
710
}
711
break;
712
- case '[':
713
- case '<':
714
case 'byline':
715
default:
716
- if(!form) continue;
717
- if(fld.id) this.addContentHookById(fld.id,form,sep);
718
- else if(fld.class){
719
- for(var i=0; i < containers.length; ++i){
720
- var container = containers[i];
721
- var fields=container.getElementsByClassName(fld.class);
722
- for(var j=0; j<fields.length; ++j){
723
- var field=fields[j];
724
- if(fld.tag && fld.tag != field.tagName) continue;
725
- if(fld.name && (!fie