-
Notifications
You must be signed in to change notification settings - Fork 147
/
qtranslate_options.php
645 lines (609 loc) · 19.4 KB
/
qtranslate_options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
<?php // encoding: utf-8
if ( !defined( 'ABSPATH' ) ) exit;
/* There is no need to edit anything here! */
define('QTX_STRING', 1);
define('QTX_BOOLEAN', 2);
define('QTX_INTEGER', 3);
define('QTX_URL', 4);
define('QTX_LANGUAGE', 5);
define('QTX_ARRAY', 6);
define('QTX_BOOLEAN_SET', 7);
define('QTX_TEXT', 8);//multi-line string
define('QTX_URL_QUERY' , 1);// query: domain.com?lang=en
define('QTX_URL_PATH' , 2);// pre path: domain.com/en
define('QTX_URL_DOMAIN' , 3);// pre domain: en.domain.com
define('QTX_URL_DOMAINS', 4);// domain per language
define('QTX_DATE_WP', 0);// default
// strftime usage (backward compability)
define('QTX_STRFTIME_OVERRIDE', 1);
define('QTX_DATE_OVERRIDE', 2);
define('QTX_DATE', 3);// old default
define('QTX_STRFTIME', 4);
define('QTX_FILTER_OPTIONS_ALL', 0);
define('QTX_FILTER_OPTIONS_LIST', 1);
define('QTX_FILTER_OPTIONS_DEFAULT','blogname blogdescription widget_%');
define('QTX_EX_DATE_FORMATS_DEFAULT','\'U\'');
define('QTX_EDITOR_MODE_LSB', 0);//Language Switching Buttons
define('QTX_EDITOR_MODE_RAW', 1);
define('QTX_EDITOR_MODE_SINGLGE', 2);
define('QTX_HIGHLIGHT_MODE_NONE', 0);
define('QTX_HIGHLIGHT_MODE_BORDER_LEFT', 1);
define('QTX_HIGHLIGHT_MODE_BORDER', 2);
define('QTX_HIGHLIGHT_MODE_LEFT_SHADOW', 3);
define('QTX_HIGHLIGHT_MODE_OUTLINE', 4);
define('QTX_HIGHLIGHT_MODE_CUSTOM_CSS', 9);
define('QTX_COOKIE_NAME_FRONT','qtrans_front_language');
define('QTX_COOKIE_NAME_ADMIN','qtrans_admin_language');
define('QTX_IGNORE_FILE_TYPES','gif,jpg,jpeg,png,svg,pdf,swf,tif,rar,zip,7z,mpg,divx,mpeg,avi,css,js,mp3,mp4,apk');
global $q_config;
global $qtranslate_options;
/**
* array of default option values
* other plugins and themes should not use global variables directly, they are subject to change at any time.
* @since 3.3
*/
function qtranxf_set_default_options(&$ops){
$ops = array();
//options processed in a standardized way
$ops['front'] = array();
$ops['front']['int']=array(
'url_mode' => QTX_URL_PATH,// sets default url mode
'use_strftime' => QTX_DATE_WP,
//'use_strftime' => QTX_DATE,// strftime usage (backward compability)
'filter_options_mode' => QTX_FILTER_OPTIONS_ALL,
'language_name_case' => 0 //Camel Case
);
$ops['front']['bool']=array(
'detect_browser_language' => true,// enables browser language detection
'hide_untranslated' => false,// hide pages without content
'show_displayed_language_prefix' => true,
'show_alternative_content_message' => true,
'show_alternative_content' => false,
'hide_default_language' => true,// hide language tag for default language in urls
'use_secure_cookie' => false,
'header_css_on' => true,
'force_markers' => false,// always keep language markers, even if the translations are all identical
);
//single line options
$ops['front']['str']=array(
);
//multi-line options
$ops['front']['text']=array(
'header_css' => 'qtranxf_front_header_css_default'
);
$ops['front']['array']=array(
//'term_name'// uniquely special treatment
'text_field_filters' => array(),
'front_config' => array()
);
//options processed in a special way
// store other default values of specially handled options
$ops['default_value']=array(
'default_language' => null,//string
'enabled_languages' => null,//array
'qtrans_compatibility' => false,//enables compatibility with former qtrans_* functions
'disable_client_cookies' => false,//bool
'flag_location' => null,//string
'filter_options' => QTX_FILTER_OPTIONS_DEFAULT,//array
'ignore_file_types' => QTX_IGNORE_FILE_TYPES,//array
'domains' => null,//array
'date_i18n' => null//array
);
//must have function 'qtranxf_default_option_name()' which returns a default value for option 'option_name'.
$ops['languages']=array(
'language_name' => 'qtranslate_language_names',
'locale' => 'qtranslate_locales',
'locale_html' => 'qtranslate_locales_html',
'not_available' => 'qtranslate_na_messages',
'flag' => 'qtranslate_flags',
'date_format' => 'qtranslate_date_formats',
'time_format' => 'qtranslate_time_formats'
//'windows_locale' => null,//this property is not stored
);
/**
* A chance to add additional options
*/
$ops = apply_filters('qtranslate_option_config',$ops);
}
/* pre-Domain Endings - for future use
$cfg['pre_domain'] = array();
$cfg['pre_domain']['de'] = 'de';
$cfg['pre_domain']['en'] = 'en';
$cfg['pre_domain']['zh'] = 'zh';
$cfg['pre_domain']['ru'] = 'ru';
$cfg['pre_domain']['fi'] = 'fs';
$cfg['pre_domain']['fr'] = 'fr';
$cfg['pre_domain']['nl'] = 'nl';
$cfg['pre_domain']['sv'] = 'sv';
$cfg['pre_domain']['it'] = 'it';
$cfg['pre_domain']['ro'] = 'ro';
$cfg['pre_domain']['hu'] = 'hu';
$cfg['pre_domain']['ja'] = 'ja';
$cfg['pre_domain']['es'] = 'es';
$cfg['pre_domain']['vi'] = 'vi';
$cfg['pre_domain']['ar'] = 'ar';
$cfg['pre_domain']['pt'] = 'pt';
$cfg['pre_domain']['pb'] = 'pb';
$cfg['pre_domain']['pl'] = 'pl';
$cfg['pre_domain']['gl'] = 'gl';
$cfg['pre_domain']['tr'] = 'tr';
*/
/**
* Names for languages in the corresponding language, add more if needed
* @since 3.3
*/
function qtranxf_default_language_name(){
//Native Name
$nnm = array();
$nnm['de'] = 'Deutsch';
$nnm['en'] = 'English';
$nnm['zh'] = '中文';// 简体中文
$nnm['ru'] = 'Русский';
$nnm['fi'] = 'suomi';
$nnm['fr'] = 'Français';
$nnm['nl'] = 'Nederlands';
$nnm['sv'] = 'Svenska';
$nnm['it'] = 'Italiano';
$nnm['ro'] = 'Română';
$nnm['hu'] = 'Magyar';
$nnm['ja'] = '日本語';
$nnm['es'] = 'Español';
$nnm['vi'] = 'Tiếng Việt';
$nnm['ar'] = 'العربية';
$nnm['pt'] = 'Português';
$nnm['pb'] = 'Português do Brasil';
$nnm['pl'] = 'Polski';
$nnm['gl'] = 'galego';
$nnm['tr'] = 'Türkçe';
$nnm['et'] = 'Eesti';
$nnm['hr'] = 'Hrvatski';
$nnm['eu'] = 'Euskera';
$nnm['el'] = 'Ελληνικά';
$nnm['ua'] = 'Українська';
$nnm['cy'] = 'Cymraeg';// Oct 22 2015
$nnm['ca'] = 'Català';//Nov 6 2015
$nnm['sk'] = 'Slovenčina';//Nov 12 2015
$nnm['sr'] = 'Српски';//Nov 19 2015
//$nnm['tw'] = '繁體中文';
return $nnm;
}
/**
* Locales for languages
* @since 3.3
*/
function qtranxf_default_locale(){
// see locale -a for available locales
$loc = array();
$loc['de'] = 'de_DE';
$loc['en'] = 'en_US';
$loc['zh'] = 'zh_CN';
$loc['ru'] = 'ru_RU';
$loc['fi'] = 'fi';//changed from fi_FI on Nov 10 2015 to match WordPress locale
$loc['fr'] = 'fr_FR';
$loc['nl'] = 'nl_NL';
$loc['sv'] = 'sv_SE';
$loc['it'] = 'it_IT';
$loc['ro'] = 'ro_RO';
$loc['hu'] = 'hu_HU';
$loc['ja'] = 'ja';
$loc['es'] = 'es_ES';
$loc['vi'] = 'vi';
$loc['ar'] = 'ar';
$loc['pt'] = 'pt_PT';
$loc['pb'] = 'pt_BR';
$loc['pl'] = 'pl_PL';
$loc['gl'] = 'gl_ES';
$loc['tr'] = 'tr_TR';
$loc['et'] = 'et';//changed from et_EE on Nov 10 2015 to match WordPress locale
$loc['hr'] = 'hr';//changed from hr_HR on Nov 10 2015 to match WordPress locale
$loc['eu'] = 'eu';//changed from eu_ES on Nov 10 2015 to match WordPress locale
$loc['el'] = 'el';//corrected from el_GR on Nov 10 2015 http://qtranslate-x.com/support/index.php?topic=27
$loc['ua'] = 'uk';
$loc['cy'] = 'cy';// not 'cy_GB'
$loc['ca'] = 'ca';
$loc['sk'] = 'sk_SK';
$loc['sr'] = 'sr_RS';
//$loc['tw'] = 'zh_TW';
return $loc;
}
/**
* HTML locales for languages
* @since 3.4
*/
function qtranxf_default_locale_html(){
//HTML locales for languages are not provided by default
$cfg = array();
return $cfg;
}
/**
* Language 'not-available' messages
* @since 3.3
*/
function qtranxf_default_not_available(){
// %LANG:<normal_separator>:<last_separator>% generates a list of languages separated by <normal_separator> except for the last one, where <last_separator> will be used instead.
//Not-Available Message
$nam = array();
//Sorry, this entry is only available in "%LANG:, :" and "%".
$nam['de'] = 'Leider ist der Eintrag nur auf %LANG:, : und % verfügbar.';//ok
$nam['en'] = 'Sorry, this entry is only available in %LANG:, : and %.';//ok
$nam['zh'] = '对不起,此内容只适用于%LANG:,:和%。';
$nam['ru'] = 'Извините, этот техт доступен только в “%LANG:”, “:” и “%”.';
//$nam['fi'] = 'Anteeksi, mutta tämä kirjoitus on saatavana ainoastaan näillä kielillä: %LANG:, : ja %.';
$nam['fi'] = 'Tämä teksti on valitettavasti saatavilla vain kielillä: %LANG:, : ja %.';//Jyrki Vanamo, Oct 20 2015, 3.4.6.5
$nam['fr'] = 'Désolé, cet article est seulement disponible en %LANG:, : et %.';
$nam['nl'] = 'Onze verontschuldigingen, dit bericht is alleen beschikbaar in %LANG:, : en %.';
$nam['sv'] = 'Tyvärr är denna artikel enbart tillgänglig på %LANG:, : och %.';
$nam['it'] = 'Ci spiace, ma questo articolo è disponibile soltanto in %LANG:, : e %.';
$nam['ro'] = 'Din păcate acest articol este disponibil doar în %LANG:, : și %.';
$nam['hu'] = 'Sajnos ennek a bejegyzésnek csak %LANG:, : és % nyelvű változata van.';
$nam['ja'] = '申し訳ありません、このコンテンツはただ今 %LANG:、 :と % のみです。';
$nam['es'] = 'Disculpa, pero esta entrada está disponible sólo en %LANG:, : y %.';
$nam['vi'] = 'Rất tiếc, mục này chỉ tồn tại ở %LANG:, : và %.';
$nam['ar'] = 'عفوا، هذه المدخلة موجودة فقط في %LANG:, : و %.';
$nam['pt'] = 'Desculpe, este conteúdo só está disponível em %LANG:, : e %.';
$nam['pb'] = 'Desculpe-nos, mas este texto está apenas disponível em %LANG:, : y %.';
$nam['pl'] = 'Przepraszamy, ten wpis jest dostępny tylko w języku %LANG:, : i %.';
$nam['gl'] = 'Sentímolo moito, ista entrada atopase unicamente en %LANG;,: e %.';
$nam['tr'] = 'Sorry, this entry is only available in %LANG:, : and %.';
$nam['et'] = 'Vabandame, see kanne on saadaval ainult %LANG : ja %.';
$nam['hr'] = 'Žao nam je, ne postoji prijevod na raspolaganju za ovaj proizvod još %LANG:, : i %.';
$nam['eu'] = 'Sentitzen dugu, baina sarrera hau %LANG-z:, : eta % bakarrik dago.';
$nam['el'] = 'Συγγνώμη,αυτή η εγγραφή είναι διαθέσιμη μόνο στα %LANG:, : και %.';
$nam['ua'] = 'Вибачте цей текст доступний тільки в “%LANG:”, “: і “%”.';
$nam['cy'] = 'Mae’n ddrwg gen i, mae\'r cofnod hwn dim ond ar gael mewn %LANG:, : a %.';
$nam['ca'] = 'Ho sentim, aquesta entrada es troba disponible únicament en %LANG:, : i %.';
$nam['sk'] = 'Ľutujeme, táto stránka je dostupná len v %LANG:, : a %.';
$nam['sr'] = 'Извините али унос је доступан једино на %LANG:, : и %.';
//$nam['tw'] = '对不起,此内容只适用于%LANG:,:和%。';
return $nam;
}
/**
* Date Configuration
* @since 3.3
*/
function qtranxf_default_date_format(){
$dtf = array();
$dtf['en'] = '%A %B %e%q, %Y';// %q ('S' for date) works in English only
$dtf['de'] = '%A, \d\e\r %e. %B %Y';
$dtf['zh'] = '%x %A';
$dtf['ru'] = '%A %B %e, %Y';
//$dtf['fi'] = '%e.&m.%C';
$dtf['fi'] = '%d.%m.%Y';//Jyrki Vanamo, Oct 20 2015, 3.4.6.5
$dtf['fr'] = '%A %e %B %Y';
$dtf['nl'] = '%d/%m/%y';
$dtf['sv'] = '%Y-%m-%d';
$dtf['it'] = '%e %B %Y';
$dtf['ro'] = '%A, %e %B %Y';
$dtf['hu'] = '%Y %B %e, %A';
$dtf['ja'] = '%Y年%m月%d日';
$dtf['es'] = '%d \d\e %B \d\e %Y';
$dtf['vi'] = '%d/%m/%Y';
$dtf['ar'] = '%d/%m/%Y';
$dtf['pt'] = '%A, %e \d\e %B \d\e %Y';
$dtf['pb'] = '%d \d\e %B \d\e %Y';
$dtf['pl'] = '%d/%m/%y';
$dtf['gl'] = '%d \d\e %B \d\e %Y';
$dtf['tr'] = '%A %B %e, %Y';
$dtf['et'] = '%A %B %e, %Y';
$dtf['hr'] = '%d/%m/%Y';
$dtf['eu'] = '%Y %B %e, %A';
$dtf['el'] = '%d/%m/%y';
$dtf['ua'] = '%A %B %e, %Y';
$dtf['cy'] = '%A %B %e, %Y';
$dtf['ca'] = 'j F, Y';
$dtf['sk'] = 'j.F Y';
$dtf['sr'] = '%A %B %e, %Y';
//$dtf['tw'] = '%x %A';
//qtranxf_test_dt_format($dtf, 'dtf', $format='F j, Y');
return $dtf;
}
/**
* Time Configuration
* @since 3.3
*/
function qtranxf_default_time_format(){
$tmf = array();
$tmf['en'] = '%I:%M %p';
$tmf['de'] = '%H:%M';
$tmf['zh'] = '%I:%M%p';
$tmf['ru'] = '%H:%M';
$tmf['fi'] = '%H:%M';
$tmf['fr'] = '%H:%M';
$tmf['nl'] = '%H:%M';
$tmf['sv'] = '%H:%M';
$tmf['it'] = '%H:%M';
$tmf['ro'] = '%H:%M';
$tmf['hu'] = '%H:%M';
$tmf['ja'] = '%H:%M';
$tmf['es'] = '%H:%M hrs.';
$tmf['vi'] = '%H:%M';
$tmf['ar'] = '%H:%M';
$tmf['pt'] = '%H:%M';
$tmf['pb'] = '%H:%M hrs.';
$tmf['pl'] = '%H:%M';
$tmf['gl'] = '%H:%M hrs.';
$tmf['tr'] = '%H:%M';
$tmf['et'] = '%H:%M';
$tmf['hr'] = '%H:%M';
$tmf['eu'] = '%H:%M';
$tmf['el'] = '%H:%M';
$tmf['ua'] = '%H:%M';
$tmf['cy'] = '%I:%M %p';//not verified
$tmf['ca'] = 'G:i';
$tmf['sk'] = 'G:i';
$tmf['sr'] = '%I:%M %p';
//$tmf['tw'] = '%I:%M%p';
//qtranxf_test_dt_format($tmf, 'tmf', $format='g:i a');
return $tmf;
}
/**
* Flag images configuration
* Look in /flags/ directory for a huge list of flags for usage
* @since 3.3
*/
function qtranxf_default_flag(){
$flg = array();
$flg['en'] = 'gb.png';
$flg['de'] = 'de.png';
$flg['zh'] = 'cn.png';
$flg['ru'] = 'ru.png';
$flg['fi'] = 'fi.png';
$flg['fr'] = 'fr.png';
$flg['nl'] = 'nl.png';
$flg['sv'] = 'se.png';
$flg['it'] = 'it.png';
$flg['ro'] = 'ro.png';
$flg['hu'] = 'hu.png';
$flg['ja'] = 'jp.png';
$flg['es'] = 'es.png';
$flg['vi'] = 'vn.png';
$flg['ar'] = 'arle.png';
$flg['pt'] = 'pt.png';
$flg['pb'] = 'br.png';
$flg['pl'] = 'pl.png';
$flg['gl'] = 'galego.png';
$flg['tr'] = 'tr.png';
$flg['et'] = 'ee.png';
$flg['hr'] = 'hr.png';
$flg['eu'] = 'eu_ES.png';
$flg['el'] = 'gr.png';
$flg['ua'] = 'ua.png';
$flg['cy'] = 'cy_GB.png';
$flg['ca'] = 'catala.png';
$flg['sk'] = 'sk.png';
$flg['sr'] = 'rs.png';
//$flg['tw'] = 'tw.png';
return $flg;
}
/**
* Full country names as locales for Windows systems
* @since 3.3
*/
function qtranxf_default_windows_locale(){
//English Name
$enm = array();
$enm['aa'] = "Afar";
$enm['ab'] = "Abkhazian";
$enm['ae'] = "Avestan";
$enm['af'] = "Afrikaans";
$enm['am'] = "Amharic";
$enm['ar'] = "Arabic";
$enm['as'] = "Assamese";
$enm['ay'] = "Aymara";
$enm['az'] = "Azerbaijani";
$enm['ba'] = "Bashkir";
$enm['be'] = "Belarusian";
$enm['bg'] = "Bulgarian";
$enm['bh'] = "Bihari";
$enm['bi'] = "Bislama";
$enm['bn'] = "Bengali";
$enm['bo'] = "Tibetan";
$enm['br'] = "Breton";
$enm['bs'] = "Bosnian";
$enm['ca'] = "Catalan";
$enm['ce'] = "Chechen";
$enm['ch'] = "Chamorro";
$enm['co'] = "Corsican";
$enm['cs'] = "Czech";
$enm['cu'] = "Church Slavic";
$enm['cv'] = "Chuvash";
$enm['cy'] = "Welsh";
$enm['da'] = "Danish";
$enm['de'] = "German";
$enm['dz'] = "Dzongkha";
$enm['el'] = "Greek";
$enm['en'] = "English";
$enm['eo'] = "Esperanto";
$enm['es'] = "Spanish";
$enm['et'] = "Estonian";
$enm['eu'] = "Basque";
$enm['fa'] = "Persian";
$enm['fi'] = "Finnish";
$enm['fj'] = "Fijian";
$enm['fo'] = "Faeroese";
$enm['fr'] = "French";
$enm['fy'] = "Frisian";
$enm['ga'] = "Irish";
$enm['gd'] = "Gaelic (Scots)";
$enm['gl'] = "Gallegan";
$enm['gn'] = "Guarani";
$enm['gu'] = "Gujarati";
$enm['gv'] = "Manx";
$enm['ha'] = "Hausa";
$enm['he'] = "Hebrew";
$enm['hi'] = "Hindi";
$enm['ho'] = "Hiri Motu";
$enm['hr'] = "Croatian";
$enm['hu'] = "Hungarian";
$enm['hy'] = "Armenian";
$enm['hz'] = "Herero";
$enm['ia'] = "Interlingua";
$enm['id'] = "Indonesian";
$enm['ie'] = "Interlingue";
$enm['ik'] = "Inupiaq";
$enm['is'] = "Icelandic";
$enm['it'] = "Italian";
$enm['iu'] = "Inuktitut";
$enm['ja'] = "Japanese";
$enm['jw'] = "Javanese";
$enm['ka'] = "Georgian";
$enm['ki'] = "Kikuyu";
$enm['kj'] = "Kuanyama";
$enm['kk'] = "Kazakh";
$enm['kl'] = "Kalaallisut";
$enm['km'] = "Khmer";
$enm['kn'] = "Kannada";
$enm['ko'] = "Korean";
$enm['ks'] = "Kashmiri";
$enm['ku'] = "Kurdish";
$enm['kv'] = "Komi";
$enm['kw'] = "Cornish";
$enm['ky'] = "Kirghiz";
$enm['la'] = "Latin";
$enm['lb'] = "Letzeburgesch";
$enm['ln'] = "Lingala";
$enm['lo'] = "Lao";
$enm['lt'] = "Lithuanian";
$enm['lv'] = "Latvian";
$enm['mg'] = "Malagasy";
$enm['mh'] = "Marshall";
$enm['mi'] = "Maori";
$enm['mk'] = "Macedonian";
$enm['ml'] = "Malayalam";
$enm['mn'] = "Mongolian";
$enm['mo'] = "Moldavian";
$enm['mr'] = "Marathi";
$enm['ms'] = "Malay";
$enm['mt'] = "Maltese";
$enm['my'] = "Burmese";
$enm['na'] = "Nauru";
$enm['nb'] = "Norwegian Bokmal";
$enm['nd'] = "Ndebele, North";
$enm['ne'] = "Nepali";
$enm['ng'] = "Ndonga";
$enm['nl'] = "Dutch";
$enm['nn'] = "Norwegian Nynorsk";
$enm['no'] = "Norwegian";
$enm['nr'] = "Ndebele, South";
$enm['nv'] = "Navajo";
$enm['ny'] = "Chichewa; Nyanja";
$enm['oc'] = "Occitan (post 1500)";
$enm['om'] = "Oromo";
$enm['or'] = "Oriya";
$enm['os'] = "Ossetian; Ossetic";
$enm['pa'] = "Panjabi";
$enm['pi'] = "Pali";
$enm['pl'] = "Polish";
$enm['ps'] = "Pushto";
$enm['pt'] = "Portuguese";
$enm['pb'] = "Brazilian Portuguese";
$enm['qu'] = "Quechua";
$enm['rm'] = "Rhaeto-Romance";
$enm['rn'] = "Rundi";
$enm['ro'] = "Romanian";
$enm['ru'] = "Russian";
$enm['rw'] = "Kinyarwanda";
$enm['sa'] = "Sanskrit";
$enm['sc'] = "Sardinian";
$enm['sd'] = "Sindhi";
$enm['se'] = "Sami";
$enm['sg'] = "Sango";
$enm['si'] = "Sinhalese";
$enm['sk'] = "Slovak";
$enm['sl'] = "Slovenian";
$enm['sm'] = "Samoan";
$enm['sn'] = "Shona";
$enm['so'] = "Somali";
$enm['sq'] = "Albanian";
$enm['sr'] = "Serbian";
$enm['ss'] = "Swati";
$enm['st'] = "Sotho";
$enm['su'] = "Sundanese";
$enm['sv'] = "Swedish";
$enm['sw'] = "Swahili";
$enm['ta'] = "Tamil";
$enm['te'] = "Telugu";
$enm['tg'] = "Tajik";
$enm['th'] = "Thai";
$enm['ti'] = "Tigrinya";
$enm['tk'] = "Turkmen";
$enm['tl'] = "Tagalog";
$enm['tn'] = "Tswana";
$enm['to'] = "Tonga";
$enm['tr'] = "Turkish";
$enm['ts'] = "Tsonga";
$enm['tt'] = "Tatar";
$enm['tw'] = "Twi";
$enm['ug'] = "Uighur";
$enm['uk'] = "Ukrainian";
$enm['ur'] = "Urdu";
$enm['uz'] = "Uzbek";
$enm['vi'] = "Vietnamese";
$enm['vo'] = "Volapuk";
$enm['wo'] = "Wolof";
$enm['xh'] = "Xhosa";
$enm['yi'] = "Yiddish";
$enm['yo'] = "Yoruba";
$enm['za'] = "Zhuang";
$enm['zh'] = "Chinese";
$enm['zu'] = "Zulu";
return $enm;
}
function qtranxf_language_predefined($lang){
$language_names = qtranxf_default_language_name();
return isset($language_names[$lang]);
}
function qtranxf_language_configured($prop,$opn=null){
$val = call_user_func('qtranxf_default_'.$prop);
if(!$opn){
global $qtranslate_options;
if(isset($qtranslate_options['languages'][$prop])){
$opn = $qtranslate_options['languages'][$prop];
}else{
$opn = 'qtranslate_'.$prop;
}
}
$opt = get_option($opn,array());
if($opt){
$val = array_merge($val,$opt);
}
return $val;
}
/**
* Load enabled languages properties from database
* @since 3.3
*/
function qtranxf_load_language_props(){
global $q_config, $qtranslate_options;
foreach($qtranslate_options['languages'] as $nm => $opn){
$f = 'qtranxf_default_'.$nm;
qtranxf_load_option_func($nm,$opn,$f);
$val = array();
$def = null;
foreach($q_config['enabled_languages'] as $lang){
if(isset($q_config[$nm][$lang])){
$val[$lang] = $q_config[$nm][$lang];
}else{
if(is_null($def) && function_exists($f)) $def = call_user_func($f);
$val[$lang] = isset($def[$lang]) ? $def[$lang] : '';
}
}
$q_config[$nm] = $val;
}
//$locales = qtranxf_default_windows_locale();
//foreach($q_config['enabled_languages'] as $lang){
// $q_config['windows_locale'][$lang] = $locales[$lang];
//}
}
function qtranxf_load_languages_enabled(){
global $q_config;
qtranxf_load_language_props();
$date_i18n = get_option('qtranslate_date_i18n');
if(is_array($date_i18n)){
$q_config['date_i18n'] = $date_i18n;
}else{
require_once(QTRANSLATE_DIR.'/admin/qtx_admin_options_update.php');
qtranxf_set_default_date_i18n($q_config,$q_config['enabled_languages']);
update_option('qtranslate_date_i18n',$q_config['date_i18n']);
}
}