[756] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * XPressME - WordPress for XOOPS
|
---|
| 4 | *
|
---|
| 5 | * @copyright XPressME Project http://www.toemon.com
|
---|
| 6 | * @license http://www.fsf.org/copyleft/gpl.html GNU public license
|
---|
| 7 | * @author toemon
|
---|
| 8 | * @package module::xpress
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | if (defined( 'XOOPS_MAINFILE_INCLUDED')) :
|
---|
| 12 | class langInfoClass {
|
---|
| 13 | var $xoops_Lang;
|
---|
| 14 | var $wp_Lang;
|
---|
| 15 | var $wp_lang_array = array(
|
---|
| 16 | array('name' => 'Afrikaans', 'xoopsLang' => '', 'wpLang' => 'af' ),
|
---|
| 17 | array('name' => 'Albanian', 'xoopsLang' => '', 'wpLang' => 'al' ),
|
---|
| 18 | array('name' => 'Arabic', 'xoopsLang' => '', 'wpLang' => 'ar' ),
|
---|
| 19 | array('name' => 'Bangla', 'xoopsLang' => '', 'wpLang' => 'bn_BD' ),
|
---|
| 20 | array('name' => 'Basque', 'xoopsLang' => '', 'wpLang' => 'eu' ),
|
---|
| 21 | array('name' => 'Belarusian', 'xoopsLang' => '', 'wpLang' => 'be_BY' ),
|
---|
| 22 | array('name' => 'Bosnian', 'xoopsLang' => '', 'wpLang' => 'bs_BA' ),
|
---|
| 23 | array('name' => 'Bulgarian', 'xoopsLang' => '', 'wpLang' => 'bg_BG' ),
|
---|
| 24 | array('name' => 'Catalan', 'xoopsLang' => '', 'wpLang' => 'ca' ),
|
---|
| 25 | array('name' => 'Chinese', 'xoopsLang' => '', 'wpLang' => 'zh_CN' ),
|
---|
| 26 | array('name' => 'Hong Kong', 'xoopsLang' => '', 'wpLang' => 'zh_HK' ),
|
---|
| 27 | array('name' => 'Taiwan', 'xoopsLang' => '', 'wpLang' => 'zh_TW' ),
|
---|
| 28 | array('name' => 'Croatian', 'xoopsLang' => '', 'wpLang' => 'hr' ),
|
---|
| 29 | array('name' => 'Czech', 'xoopsLang' => '', 'wpLang' => 'cs_CZ' ),
|
---|
| 30 | array('name' => 'Danish', 'xoopsLang' => '', 'wpLang' => 'da_DK' ),
|
---|
| 31 | array('name' => 'Dutch', 'xoopsLang' => '', 'wpLang' => 'nl_NL' ),
|
---|
| 32 | array('name' => 'English', 'xoopsLang' => 'english', 'wpLang' => 'en_US' ),
|
---|
| 33 | array('name' => 'Esperanto', 'xoopsLang' => '', 'wpLang' => 'eo' ),
|
---|
| 34 | array('name' => 'Estonian', 'xoopsLang' => '', 'wpLang' => 'et' ),
|
---|
| 35 | array('name' => 'Faroese', 'xoopsLang' => '', 'wpLang' => 'fo' ),
|
---|
| 36 | array('name' => 'Finnish', 'xoopsLang' => '', 'wpLang' => 'fi' ),
|
---|
| 37 | array('name' => 'Galician', 'xoopsLang' => '', 'wpLang' => 'gl_ES' ),
|
---|
| 38 | array('name' => 'Georgian', 'xoopsLang' => '', 'wpLang' => 'ge_GE' ),
|
---|
| 39 | array('name' => 'German', 'xoopsLang' => '', 'wpLang' => 'de_DE' ),
|
---|
| 40 | array('name' => 'Greek', 'xoopsLang' => '', 'wpLang' => 'el' ),
|
---|
| 41 | array('name' => 'Hebrew', 'xoopsLang' => '', 'wpLang' => 'he_IL' ),
|
---|
| 42 | array('name' => 'Hungarian', 'xoopsLang' => '', 'wpLang' => 'hu_HU' ),
|
---|
| 43 | array('name' => 'Icelandic', 'xoopsLang' => '', 'wpLang' => 'is_IS' ),
|
---|
| 44 | array('name' => 'Indonesian', 'xoopsLang' => '', 'wpLang' => 'id_ID' ),
|
---|
| 45 | array('name' => 'Italian', 'xoopsLang' => '', 'wpLang' => 'it_IT' ),
|
---|
| 46 | array('name' => 'Japanese', 'xoopsLang' => 'japanese', 'wpLang' => 'ja' ),
|
---|
| 47 | array('name' => 'Japanese_utf8', 'xoopsLang' => 'ja_utf8', 'wpLang' => 'ja' ),
|
---|
| 48 | array('name' => 'Khmer', 'xoopsLang' => '', 'wpLang' => 'km_KH' ),
|
---|
| 49 | array('name' => 'Korean', 'xoopsLang' => 'ko_utf8', 'wpLang' => 'ko_KR' ),
|
---|
| 50 | array('name' => 'Latvian', 'xoopsLang' => '', 'wpLang' => 'lv' ),
|
---|
| 51 | array('name' => 'Lithuanian', 'xoopsLang' => '', 'wpLang' => 'lt_LT' ),
|
---|
| 52 | array('name' => 'Macedonian', 'xoopsLang' => '', 'wpLang' => 'mk_MK' ),
|
---|
| 53 | array('name' => 'Malagasy', 'xoopsLang' => '', 'wpLang' => 'mg_MG' ),
|
---|
| 54 | array('name' => 'Malay', 'xoopsLang' => '', 'wpLang' => 'ms_MY' ),
|
---|
| 55 | array('name' => 'Nias', 'xoopsLang' => '', 'wpLang' => 'ni_ID' ),
|
---|
| 56 | array('name' => 'Norwegian', 'xoopsLang' => '', 'wpLang' => 'nb_NO' ),
|
---|
| 57 | array('name' => 'Persian', 'xoopsLang' => '', 'wpLang' => 'fa_IR' ),
|
---|
| 58 | array('name' => 'Polish', 'xoopsLang' => '', 'wpLang' => 'pl_PL' ),
|
---|
| 59 | array('name' => 'European Portuguese', 'xoopsLang' => '', 'wpLang' => 'pt_PT' ),
|
---|
| 60 | array('name' => 'Brazilian Portuguese', 'xoopsLang' => 'pt-br_utf8', 'wpLang' => 'pt_BR' ),
|
---|
| 61 | array('name' => 'Romanian', 'xoopsLang' => '', 'wpLang' => 'ro' ),
|
---|
| 62 | array('name' => 'Russian', 'xoopsLang' => '', 'wpLang' => 'ru_RU' ),
|
---|
| 63 | array('name' => 'Serbian', 'xoopsLang' => '', 'wpLang' => 'sr_RS' ),
|
---|
| 64 | array('name' => 'Sinhala', 'xoopsLang' => '', 'wpLang' => 'si_LK' ),
|
---|
| 65 | array('name' => 'Slovak', 'xoopsLang' => '', 'wpLang' => 'sk_SK' ),
|
---|
| 66 | array('name' => 'Slovenian', 'xoopsLang' => '', 'wpLang' => 'sl_SI' ),
|
---|
| 67 | array('name' => 'Spanish', 'xoopsLang' => '', 'wpLang' => 'es_ES' ),
|
---|
| 68 | array('name' => 'Sundanese', 'xoopsLang' => '', 'wpLang' => 'su_ID' ),
|
---|
| 69 | array('name' => 'Swedish', 'xoopsLang' => '', 'wpLang' => 'sv_SE' ),
|
---|
| 70 | array('name' => 'Tajik', 'xoopsLang' => '', 'wpLang' => 'tg' ),
|
---|
| 71 | array('name' => 'Thai', 'xoopsLang' => '', 'wpLang' => 'th' ),
|
---|
| 72 | array('name' => 'Turkish', 'xoopsLang' => '', 'wpLang' => 'tr' ),
|
---|
| 73 | array('name' => 'Ukrainian', 'xoopsLang' => '', 'wpLang' => 'uk' ),
|
---|
| 74 | array('name' => 'Uzbek', 'xoopsLang' => '', 'wpLang' => 'uz_UZ' ),
|
---|
| 75 | array('name' => 'Vietnamse', 'xoopsLang' => '', 'wpLang' => 'vi' ),
|
---|
| 76 | array('name' => 'Welsh', 'xoopsLang' => '', 'wpLang' => 'cy' ),
|
---|
| 77 | );
|
---|
| 78 |
|
---|
| 79 | function __constructor() //for PHP5
|
---|
| 80 | {
|
---|
| 81 | $this->langInfoClass();
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | function langInfoClass() //for PHP4 constructor
|
---|
| 85 | {
|
---|
| 86 | $this->xoops_Lang = @$GLOBALS["xoopsConfig"]['language'];
|
---|
| 87 | $this->wp_Lang = $this->get_wpLang();
|
---|
| 88 | }
|
---|
| 89 | function get_wpLang($xoops_Lang = '')
|
---|
| 90 | {
|
---|
| 91 | if(empty($xoops_Lang)) $xoops_Lang = $this->xoops_Lang;
|
---|
| 92 | foreach($this->wp_lang_array as $lang){
|
---|
| 93 | if ($lang['xoopsLang'] === $xoops_Lang) return $lang['wpLang'];
|
---|
| 94 | }
|
---|
| 95 | return 'en_US';
|
---|
| 96 | }
|
---|
| 97 | function get_xoopsLang()
|
---|
| 98 | {
|
---|
| 99 | return $this->xoops_Lang;
|
---|
| 100 | }
|
---|
| 101 | function get_LangList()
|
---|
| 102 | {
|
---|
| 103 | return $this->$wp_lang_array;
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | }
|
---|
| 107 | endif;
|
---|
| 108 | ?> |
---|