mudzakkir

qtranslate_final_code

Dec 30th, 2012
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.31 KB | None | 0 0
  1. <?php
  2.  
  3. // encoding: utf-8
  4. /*
  5. Plugin Name: qTranslate
  6. Plugin URI: http://www.qianqin.de/qtranslate/
  7. Description: Adds userfriendly multilingual content support into Wordpress. For Problems visit the <a href="http://www.qianqin.de/qtranslate/forum/">Support Forum</a>.
  8. Version: 2.5.32
  9. Author: Qian Qin
  10. Author URI: http://www.qianqin.de
  11. Tags: multilingual, multi, language, admin, tinymce, qTranslate, Polyglot, bilingual, widget, switcher, professional, human, translation, service
  12. */
  13. /*
  14. Most flags in flags directory are made by Luc Balemans and downloaded from
  15. FOTW Flags Of The World website at http://flagspot.net/flags/
  16. (http://www.crwflags.com/FOTW/FLAGS/wflags.html)
  17. */
  18. /* Copyright 2008 Qian Qin (email : [email protected])
  19.  
  20. This program is free software; you can redistribute it and/or modify
  21. it under the terms of the GNU General Public License as published by
  22. the Free Software Foundation; either version 2 of the License, or
  23. (at your option) any later version.
  24.  
  25. This program is distributed in the hope that it will be useful,
  26. but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. GNU General Public License for more details.
  29.  
  30. You should have received a copy of the GNU General Public License
  31. along with this program; if not, write to the Free Software
  32. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  33. */
  34. /*
  35. Default Language Contributers
  36. =============================
  37. en, de by Qian Qin
  38. zh by Junyan Chen
  39. fi by Tatu Siltanen
  40. fr by Damien Choizit
  41. nl by RobV
  42. sv by bear3556, johdah
  43. it by Lorenzo De Tomasi
  44. ro, hu by Jani Monoses
  45. ja by Brian Parker
  46. es by June
  47. vi by hathhai
  48. ar by Mohamed Magdy
  49. pt by netolazaro
  50. gl by Andrés Bott
  51.  
  52. Plugin Translation Contributers
  53. ===============================
  54. en, de by Qian Qin
  55. es_ES by Alejandro Urrutia
  56. fr by eriath
  57. tr by freeuser
  58. it by shecky
  59. nl by BlackDex
  60. id by Masino Sinaga
  61. pt by claudiotereso
  62. az by evlenirikbiz
  63. bg by Dimitar Mitev
  64. da by meviper
  65. mk by Pavle Boskoski
  66. cz by bengo
  67. ja by dapperdanman1400
  68. ms by webgrrrl
  69. es_CA by CarlosSanz
  70. hu by nb000
  71. zh_CN by silverfox
  72. eo by Chuck Smith
  73. pt_BR by Marcelo Paoli
  74. ru by viaestvita
  75. ro by ipuiu
  76. sv by tobi
  77.  
  78. Sponsored Features
  79. ==================
  80. Excerpt Translation by bastiaan van rooden (www.nothing.ch)
  81.  
  82. Specials thanks
  83. ===============
  84. All Supporters! Thanks for all the gifts, cards and donations!
  85. */
  86. /* DEFAULT CONFIGURATION PART BEGINS HERE */
  87.  
  88. /* There is no need to edit anything here! */
  89.  
  90. // qTranslate Editor will only activated for the given version of Wordpress.
  91. // Can be changed to use with other versions but might cause problems and/or data loss!
  92. define('QT_SUPPORTED_WP_VERSION', '3.4.2');
  93. define('QT_STRING', 1);
  94. define('QT_BOOLEAN', 2);
  95. define('QT_INTEGER', 3);
  96. define('QT_URL', 4);
  97. define('QT_LANGUAGE', 5);
  98. define('QT_URL_QUERY', 1);
  99. define('QT_URL_PATH', 2);
  100. define('QT_URL_DOMAIN', 3);
  101. define('QT_STRFTIME_OVERRIDE', 1);
  102. define('QT_DATE_OVERRIDE', 2);
  103. define('QT_DATE', 3);
  104. define('QT_STRFTIME', 4);
  105.  
  106. // enable the use of following languages (order=>language)
  107. $q_config['enabled_languages'] = array(
  108. '0' => 'de',
  109. '1' => 'en',
  110. '2' => 'zh'
  111. );
  112.  
  113. // sets default language
  114. $q_config['default_language'] = 'en';
  115.  
  116. // enables browser language detection
  117. $q_config['detect_browser_language'] = true;
  118.  
  119. // hide pages without content
  120. $q_config['hide_untranslated'] = false;
  121.  
  122. // automatically update .mo files
  123. $q_config['auto_update_mo'] = true;
  124.  
  125. // hide language tag for default language
  126. $q_config['hide_default_language'] = true;
  127.  
  128. // sets default url mode
  129. // QT_URL_QUERY - query (questionmark)
  130. // QT_URL_PATH - pre-path
  131. // QT_URL_DOMAIN - pre-domain
  132. $q_config['url_mode'] = QT_URL_PATH;
  133.  
  134. // pre-Domain Endings - for future use
  135. $q_config['pre_domain']['de'] = "de";
  136. $q_config['pre_domain']['en'] = "en";
  137. $q_config['pre_domain']['zh'] = "zh";
  138. $q_config['pre_domain']['fi'] = "fs";
  139. $q_config['pre_domain']['fr'] = "fr";
  140. $q_config['pre_domain']['nl'] = "nl";
  141. $q_config['pre_domain']['sv'] = "sv";
  142. $q_config['pre_domain']['it'] = "it";
  143. $q_config['pre_domain']['ro'] = "ro";
  144. $q_config['pre_domain']['hu'] = "hu";
  145. $q_config['pre_domain']['ja'] = "ja";
  146. $q_config['pre_domain']['es'] = "es";
  147. $q_config['pre_domain']['vi'] = "vi";
  148. $q_config['pre_domain']['ar'] = "ar";
  149. $q_config['pre_domain']['pt'] = "pt";
  150. $q_config['pre_domain']['pl'] = "pl";
  151. $q_config['pre_domain']['gl'] = "gl";
  152.  
  153. // Names for languages in the corresponding language, add more if needed
  154. $q_config['language_name']['de'] = "Deutsch";
  155. $q_config['language_name']['en'] = "English";
  156. $q_config['language_name']['zh'] = "??";
  157. $q_config['language_name']['fi'] = "suomi";
  158. $q_config['language_name']['fr'] = "Français";
  159. $q_config['language_name']['nl'] = "Nederlands";
  160. $q_config['language_name']['sv'] = "Svenska";
  161. $q_config['language_name']['it'] = "Italiano";
  162. $q_config['language_name']['ro'] = "Româna";
  163. $q_config['language_name']['hu'] = "Magyar";
  164. $q_config['language_name']['ja'] = "???";
  165. $q_config['language_name']['es'] = "Español";
  166. $q_config['language_name']['vi'] = "Ti?ng Vi?t";
  167. $q_config['language_name']['ar'] = "???????";
  168. $q_config['language_name']['pt'] = "Português";
  169. $q_config['language_name']['pl'] = "Polski";
  170. $q_config['language_name']['gl'] = "galego";
  171.  
  172. // Locales for languages
  173. // see locale -a for available locales
  174. $q_config['locale']['de'] = "de_DE";
  175. $q_config['locale']['en'] = "en_US";
  176. $q_config['locale']['zh'] = "zh_CN";
  177. $q_config['locale']['fi'] = "fi";
  178. $q_config['locale']['fr'] = "fr_FR";
  179. $q_config['locale']['nl'] = "nl_NL";
  180. $q_config['locale']['sv'] = "sv_SE";
  181. $q_config['locale']['it'] = "it_IT";
  182. $q_config['locale']['ro'] = "ro_RO";
  183. $q_config['locale']['hu'] = "hu_HU";
  184. $q_config['locale']['ja'] = "ja";
  185. $q_config['locale']['es'] = "es_ES";
  186. $q_config['locale']['vi'] = "vi";
  187. $q_config['locale']['ar'] = "ar";
  188. $q_config['locale']['pt'] = "pt_BR";
  189. $q_config['locale']['pl'] = "pl_PL";
  190. $q_config['locale']['gl'] = "gl_ES";
  191. // Language not available messages
  192. // %LANG:<normal_seperator>:<last_seperator>% generates a list of languages seperated by <normal_seperator> except for the last one, where <last_seperator> will be used instead.
  193. $q_config['not_available']['de'] = "Leider ist der Eintrag nur auf %LANG:, : und % verfügbar.";
  194. $q_config['not_available']['en'] = "Sorry, this entry is only available in %LANG:, : and %.";
  195. $q_config['not_available']['zh'] = "???,???????%LANG:,:?%?";
  196. $q_config['not_available']['fi'] = "Anteeksi, mutta tämä kirjoitus on saatavana ainoastaan näillä kielillä: %LANG:, : ja %.";
  197. $q_config['not_available']['fr'] = "Désolé, cet article est seulement disponible en %LANG:, : et %.";
  198. $q_config['not_available']['nl'] = "Onze verontschuldigingen, dit bericht is alleen beschikbaar in %LANG:, : en %.";
  199. $q_config['not_available']['sv'] = "Tyvärr är denna artikel enbart tillgänglig på %LANG:, : och %.";
  200. $q_config['not_available']['it'] = "Ci spiace, ma questo articolo è disponibile soltanto in %LANG:, : e %.";
  201. $q_config['not_available']['ro'] = "Din pacate acest articol este disponibil doar în %LANG:, : ?i %.";
  202. $q_config['not_available']['hu'] = "Sajnos ennek a bejegyzésnek csak %LANG:, : és % nyelvu változata van.";
  203. $q_config['not_available']['ja'] = "???????????????????? %LANG:? :? % ?????";
  204. $q_config['not_available']['es'] = "Disculpa, pero esta entrada está disponible sólo en %LANG:, : y %.";
  205. $q_config['not_available']['vi'] = "R?t ti?c, m?c này ch? t?n t?i ? %LANG:, : và %.";
  206. $q_config['not_available']['ar'] = "????? ??? ??????? ?????? ??? ?? %LANG:, : ? %.";
  207. $q_config['not_available']['pt'] = "Desculpe-nos, mas este texto esta apenas disponível em %LANG:, : y %.";
  208. $q_config['not_available']['pl'] = "Przepraszamy, ten wpis jest dostepny tylko w jezyku %LANG:, : i %.";
  209. $q_config['not_available']['gl'] = "Sentímolo moito, ista entrada atopase unicamente en %LANG;,: e %.";
  210. // qTranslate Services
  211. $q_config['qtranslate_services'] = false;
  212. // strftime usage (backward compability)
  213. $q_config['use_strftime'] = QT_DATE;
  214. // Date Configuration
  215. $q_config['date_format']['en'] = '%A %B %e%q, %Y';
  216. $q_config['date_format']['de'] = '%A, der %e. %B %Y';
  217. $q_config['date_format']['zh'] = '%x %A';
  218. $q_config['date_format']['fi'] = '%e.&m.%C';
  219. $q_config['date_format']['fr'] = '%A %e %B %Y';
  220. $q_config['date_format']['nl'] = '%d/%m/%y';
  221. $q_config['date_format']['sv'] = '%Y/%m/%d';
  222. $q_config['date_format']['it'] = '%e %B %Y';
  223. $q_config['date_format']['ro'] = '%A, %e %B %Y';
  224. $q_config['date_format']['hu'] = '%Y %B %e, %A';
  225. $q_config['date_format']['ja'] = '%Y?%m?%d?';
  226. $q_config['date_format']['es'] = '%d de %B de %Y';
  227. $q_config['date_format']['vi'] = '%d/%m/%Y';
  228. $q_config['date_format']['ar'] = '%d/%m/%Y';
  229. $q_config['date_format']['pt'] = '%d de %B de %Y';
  230. $q_config['date_format']['pl'] = '%d/%m/%y';
  231. $q_config['date_format']['gl'] = '%d de %B de %Y';
  232. $q_config['time_format']['en'] = '%I:%M %p';
  233. $q_config['time_format']['de'] = '%H:%M';
  234. $q_config['time_format']['zh'] = '%I:%M%p';
  235. $q_config['time_format']['fi'] = '%H:%M';
  236. $q_config['time_format']['fr'] = '%H:%M';
  237. $q_config['time_format']['nl'] = '%H:%M';
  238. $q_config['time_format']['sv'] = '%H:%M';
  239. $q_config['time_format']['it'] = '%H:%M';
  240. $q_config['time_format']['ro'] = '%H:%M';
  241. $q_config['time_format']['hu'] = '%H:%M';
  242. $q_config['time_format']['ja'] = '%H:%M';
  243. $q_config['time_format']['es'] = '%H:%M hrs.';
  244. $q_config['time_format']['vi'] = '%H:%M';
  245. $q_config['time_format']['ar'] = '%H:%M';
  246. $q_config['time_format']['pt'] = '%H:%M hrs.';
  247. $q_config['time_format']['pl'] = '%H:%M';
  248. $q_config['time_format']['gl'] = '%H:%M hrs.';
  249.  
  250. // Flag images configuration
  251. // Look in /flags/ directory for a huge list of flags for usage
  252. $q_config['flag']['en'] = 'gb.png';
  253. $q_config['flag']['de'] = 'de.png';
  254. $q_config['flag']['zh'] = 'cn.png';
  255. $q_config['flag']['fi'] = 'fi.png';
  256. $q_config['flag']['fr'] = 'fr.png';
  257. $q_config['flag']['nl'] = 'nl.png';
  258. $q_config['flag']['sv'] = 'se.png';
  259. $q_config['flag']['it'] = 'it.png';
  260. $q_config['flag']['ro'] = 'ro.png';
  261. $q_config['flag']['hu'] = 'hu.png';
  262. $q_config['flag']['ja'] = 'jp.png';
  263. $q_config['flag']['es'] = 'es.png';
  264. $q_config['flag']['vi'] = 'vn.png';
  265. $q_config['flag']['ar'] = 'arle.png';
  266. $q_config['flag']['pt'] = 'br.png';
  267. $q_config['flag']['pt'] = 'br.png';
  268. $q_config['flag']['gl'] = 'galego.png';
  269.  
  270. // Location of flags (needs trailing slash!)
  271. $q_config['flag_location'] = 'plugins/qtranslate/flags/';
  272.  
  273. // Don't convert URLs to this file types
  274. $q_config['ignore_file_types'] = 'gif,jpg,jpeg,png,pdf,swf,tif,rar,zip,7z,mpg,divx,mpeg,avi,css,js';
  275.  
  276. /* DEFAULT CONFIGURATION PART ENDS HERE */
  277.  
  278. $q_config['term_name'] = array();
  279.  
  280. // Full country names as locales for Windows systems
  281. $q_config['windows_locale']['aa'] = "Afar";
  282. $q_config['windows_locale']['ab'] = "Abkhazian";
  283. $q_config['windows_locale']['ae'] = "Avestan";
  284. $q_config['windows_locale']['af'] = "Afrikaans";
  285. $q_config['windows_locale']['am'] = "Amharic";
  286. $q_config['windows_locale']['ar'] = "Arabic";
  287. $q_config['windows_locale']['as'] = "Assamese";
  288. $q_config['windows_locale']['ay'] = "Aymara";
  289. $q_config['windows_locale']['az'] = "Azerbaijani";
  290. $q_config['windows_locale']['ba'] = "Bashkir";
  291. $q_config['windows_locale']['be'] = "Belarusian";
  292. $q_config['windows_locale']['bg'] = "Bulgarian";
  293. $q_config['windows_locale']['bh'] = "Bihari";
  294. $q_config['windows_locale']['bi'] = "Bislama";
  295. $q_config['windows_locale']['bn'] = "Bengali";
  296. $q_config['windows_locale']['bo'] = "Tibetan";
  297. $q_config['windows_locale']['br'] = "Breton";
  298. $q_config['windows_locale']['bs'] = "Bosnian";
  299. $q_config['windows_locale']['ca'] = "Catalan";
  300. $q_config['windows_locale']['ce'] = "Chechen";
  301. $q_config['windows_locale']['ch'] = "Chamorro";
  302. $q_config['windows_locale']['co'] = "Corsican";
  303. $q_config['windows_locale']['cs'] = "Czech";
  304. $q_config['windows_locale']['cu'] = "Church Slavic";
  305. $q_config['windows_locale']['cv'] = "Chuvash";
  306. $q_config['windows_locale']['cy'] = "Welsh";
  307. $q_config['windows_locale']['da'] = "Danish";
  308. $q_config['windows_locale']['de'] = "German";
  309. $q_config['windows_locale']['dz'] = "Dzongkha";
  310. $q_config['windows_locale']['el'] = "Greek";
  311. $q_config['windows_locale']['en'] = "English";
  312. $q_config['windows_locale']['eo'] = "Esperanto";
  313. $q_config['windows_locale']['es'] = "Spanish";
  314. $q_config['windows_locale']['et'] = "Estonian";
  315. $q_config['windows_locale']['eu'] = "Basque";
  316. $q_config['windows_locale']['fa'] = "Persian";
  317. $q_config['windows_locale']['fi'] = "Finnish";
  318. $q_config['windows_locale']['fj'] = "Fijian";
  319. $q_config['windows_locale']['fo'] = "Faeroese";
  320. $q_config['windows_locale']['fr'] = "French";
  321. $q_config['windows_locale']['fy'] = "Frisian";
  322. $q_config['windows_locale']['ga'] = "Irish";
  323. $q_config['windows_locale']['gd'] = "Gaelic (Scots)";
  324. $q_config['windows_locale']['gl'] = "Gallegan";
  325. $q_config['windows_locale']['gn'] = "Guarani";
  326. $q_config['windows_locale']['gu'] = "Gujarati";
  327. $q_config['windows_locale']['gv'] = "Manx";
  328. $q_config['windows_locale']['ha'] = "Hausa";
  329. $q_config['windows_locale']['he'] = "Hebrew";
  330. $q_config['windows_locale']['hi'] = "Hindi";
  331. $q_config['windows_locale']['ho'] = "Hiri Motu";
  332. $q_config['windows_locale']['hr'] = "Croatian";
  333. $q_config['windows_locale']['hu'] = "Hungarian";
  334. $q_config['windows_locale']['hy'] = "Armenian";
  335. $q_config['windows_locale']['hz'] = "Herero";
  336. $q_config['windows_locale']['ia'] = "Interlingua";
  337. $q_config['windows_locale']['id'] = "Indonesian";
  338. $q_config['windows_locale']['ie'] = "Interlingue";
  339. $q_config['windows_locale']['ik'] = "Inupiaq";
  340. $q_config['windows_locale']['is'] = "Icelandic";
  341. $q_config['windows_locale']['it'] = "Italian";
  342. $q_config['windows_locale']['iu'] = "Inuktitut";
  343. $q_config['windows_locale']['ja'] = "Japanese";
  344. $q_config['windows_locale']['jw'] = "Javanese";
  345. $q_config['windows_locale']['ka'] = "Georgian";
  346. $q_config['windows_locale']['ki'] = "Kikuyu";
  347. $q_config['windows_locale']['kj'] = "Kuanyama";
  348. $q_config['windows_locale']['kk'] = "Kazakh";
  349. $q_config['windows_locale']['kl'] = "Kalaallisut";
  350. $q_config['windows_locale']['km'] = "Khmer";
  351. $q_config['windows_locale']['kn'] = "Kannada";
  352. $q_config['windows_locale']['ko'] = "Korean";
  353. $q_config['windows_locale']['ks'] = "Kashmiri";
  354. $q_config['windows_locale']['ku'] = "Kurdish";
  355. $q_config['windows_locale']['kv'] = "Komi";
  356. $q_config['windows_locale']['kw'] = "Cornish";
  357. $q_config['windows_locale']['ky'] = "Kirghiz";
  358. $q_config['windows_locale']['la'] = "Latin";
  359. $q_config['windows_locale']['lb'] = "Letzeburgesch";
  360. $q_config['windows_locale']['ln'] = "Lingala";
  361. $q_config['windows_locale']['lo'] = "Lao";
  362. $q_config['windows_locale']['lt'] = "Lithuanian";
  363. $q_config['windows_locale']['lv'] = "Latvian";
  364. $q_config['windows_locale']['mg'] = "Malagasy";
  365. $q_config['windows_locale']['mh'] = "Marshall";
  366. $q_config['windows_locale']['mi'] = "Maori";
  367. $q_config['windows_locale']['mk'] = "Macedonian";
  368. $q_config['windows_locale']['ml'] = "Malayalam";
  369. $q_config['windows_locale']['mn'] = "Mongolian";
  370. $q_config['windows_locale']['mo'] = "Moldavian";
  371. $q_config['windows_locale']['mr'] = "Marathi";
  372. $q_config['windows_locale']['ms'] = "Malay";
  373. $q_config['windows_locale']['mt'] = "Maltese";
  374. $q_config['windows_locale']['my'] = "Burmese";
  375. $q_config['windows_locale']['na'] = "Nauru";
  376. $q_config['windows_locale']['nb'] = "Norwegian Bokmal";
  377. $q_config['windows_locale']['nd'] = "Ndebele, North";
  378. $q_config['windows_locale']['ne'] = "Nepali";
  379. $q_config['windows_locale']['ng'] = "Ndonga";
  380. $q_config['windows_locale']['nl'] = "Dutch";
  381. $q_config['windows_locale']['nn'] = "Norwegian Nynorsk";
  382. $q_config['windows_locale']['no'] = "Norwegian";
  383. $q_config['windows_locale']['nr'] = "Ndebele, South";
  384. $q_config['windows_locale']['nv'] = "Navajo";
  385. $q_config['windows_locale']['ny'] = "Chichewa; Nyanja";
  386. $q_config['windows_locale']['oc'] = "Occitan (post 1500)";
  387. $q_config['windows_locale']['om'] = "Oromo";
  388. $q_config['windows_locale']['or'] = "Oriya";
  389. $q_config['windows_locale']['os'] = "Ossetian; Ossetic";
  390. $q_config['windows_locale']['pa'] = "Panjabi";
  391. $q_config['windows_locale']['pi'] = "Pali";
  392. $q_config['windows_locale']['pl'] = "Polish";
  393. $q_config['windows_locale']['ps'] = "Pushto";
  394. $q_config['windows_locale']['pt'] = "Portuguese";
  395. $q_config['windows_locale']['qu'] = "Quechua";
  396. $q_config['windows_locale']['rm'] = "Rhaeto-Romance";
  397. $q_config['windows_locale']['rn'] = "Rundi";
  398. $q_config['windows_locale']['ro'] = "Romanian";
  399. $q_config['windows_locale']['ru'] = "Russian";
  400. $q_config['windows_locale']['rw'] = "Kinyarwanda";
  401. $q_config['windows_locale']['sa'] = "Sanskrit";
  402. $q_config['windows_locale']['sc'] = "Sardinian";
  403. $q_config['windows_locale']['sd'] = "Sindhi";
  404. $q_config['windows_locale']['se'] = "Sami";
  405. $q_config['windows_locale']['sg'] = "Sango";
  406. $q_config['windows_locale']['si'] = "Sinhalese";
  407. $q_config['windows_locale']['sk'] = "Slovak";
  408. $q_config['windows_locale']['sl'] = "Slovenian";
  409. $q_config['windows_locale']['sm'] = "Samoan";
  410. $q_config['windows_locale']['sn'] = "Shona";
  411. $q_config['windows_locale']['so'] = "Somali";
  412. $q_config['windows_locale']['sq'] = "Albanian";
  413. $q_config['windows_locale']['sr'] = "Serbian";
  414. $q_config['windows_locale']['ss'] = "Swati";
  415. $q_config['windows_locale']['st'] = "Sotho";
  416. $q_config['windows_locale']['su'] = "Sundanese";
  417. $q_config['windows_locale']['sv'] = "Swedish";
  418. $q_config['windows_locale']['sw'] = "Swahili";
  419. $q_config['windows_locale']['ta'] = "Tamil";
  420. $q_config['windows_locale']['te'] = "Telugu";
  421. $q_config['windows_locale']['tg'] = "Tajik";
  422. $q_config['windows_locale']['th'] = "Thai";
  423. $q_config['windows_locale']['ti'] = "Tigrinya";
  424. $q_config['windows_locale']['tk'] = "Turkmen";
  425. $q_config['windows_locale']['tl'] = "Tagalog";
  426. $q_config['windows_locale']['tn'] = "Tswana";
  427. $q_config['windows_locale']['to'] = "Tonga";
  428. $q_config['windows_locale']['tr'] = "Turkish";
  429. $q_config['windows_locale']['ts'] = "Tsonga";
  430. $q_config['windows_locale']['tt'] = "Tatar";
  431. $q_config['windows_locale']['tw'] = "Twi";
  432. $q_config['windows_locale']['ug'] = "Uighur";
  433. $q_config['windows_locale']['uk'] = "Ukrainian";
  434. $q_config['windows_locale']['ur'] = "Urdu";
  435. $q_config['windows_locale']['uz'] = "Uzbek";
  436. $q_config['windows_locale']['vi'] = "Vietnamese";
  437. $q_config['windows_locale']['vo'] = "Volapuk";
  438. $q_config['windows_locale']['wo'] = "Wolof";
  439. $q_config['windows_locale']['xh'] = "Xhosa";
  440. $q_config['windows_locale']['yi'] = "Yiddish";
  441. $q_config['windows_locale']['yo'] = "Yoruba";
  442. $q_config['windows_locale']['za'] = "Zhuang";
  443. $q_config['windows_locale']['zh'] = "Chinese";
  444. $q_config['windows_locale']['zu'] = "Zulu";
  445.  
  446. // Load qTranslate
  447. require_once(dirname(__FILE__) . "/qtranslate_javascript.php");
  448. require_once(dirname(__FILE__) . "/qtranslate_utils.php");
  449. require_once(dirname(__FILE__) . "/qtranslate_core.php");
  450. require_once(dirname(__FILE__) . "/qtranslate_wphacks.php");
  451. require_once(dirname(__FILE__) . "/qtranslate_widget.php");
  452. require_once(dirname(__FILE__) . "/qtranslate_configuration.php");
  453.  
  454. // load qTranslate Services if available
  455. if (file_exists(dirname(__FILE__) . "/qtranslate_services.php"))
  456. require_once(dirname(__FILE__) . "/qtranslate_services.php");
  457.  
  458. // set hooks at the end
  459. require_once(dirname(__FILE__) . "/qtranslate_hooks.php");
  460.  
  461. //ADDED CODE
  462. if (!function_exists('printFlags')) {
  463. function printFlags() {
  464. if (is_404())
  465. $url = get_option('home'); else
  466. $url = '';
  467. $result = '<ul>';
  468. foreach (qtrans_getSortedLanguages() as $language) {
  469. $result .= '<li';
  470. if ($language == $q_config['language'])
  471. $result .= ' class="active"';
  472. $result .= '><a href="' . qtrans_convertURL($url, $language) . '"';
  473. $result .= ' class="qtrans_flag_' . $language . ' qtrans_flag_and_text" title="' . $q_config['language_name'][$language] . '"';
  474. $result .= '><span>' . $q_config['language_name'][$language] . '</span></a></li>';
  475. }
  476. $result .= "</ul>";
  477. $result = str_replace(array('<span></span>'), '', $result);
  478. $result = str_replace(array('<div></div>'), '', $result);
  479. echo "<script>
  480. jQuery(document).ready(function(){
  481. jQuery('#switch_lang').html('$result<span>&nbsp</span><div>&nbsp</div>');
  482. });
  483. </script>";
  484. }
  485.  
  486. }
  487. add_action('wp_head', 'printFlags');
  488. ?>
Advertisement
Add Comment
Please, Sign In to add comment