ion = '0'; $su->google_code = 'su'; $sv = new GP_Locale(); $sv->english_name = 'Swedish'; $sv->native_name = 'Svenska'; $sv->lang_code_iso_639_1 = 'sv'; $sv->lang_code_iso_639_2 = 'swe'; $sv->country_code = 'se'; $sv->wp_locale = 'sv_SE'; $sv->slug = 'sv'; $sv->google_code = 'sv'; $sv->facebook_locale = 'sv_SE'; $sw = new GP_Locale(); $sw->english_name = 'Swahili'; $sw->native_name = 'Kiswahili'; $sw->lang_code_iso_639_1 = 'sw'; $sw->lang_code_iso_639_2 = 'swa'; $sw->wp_locale = 'sw'; $sw->slug = 'sw'; $sw->google_code = 'sw'; $sw->facebook_locale = 'sw_KE'; $syr = new GP_Locale(); $syr->english_name = 'Syriac'; $syr->native_name = 'Syriac'; $syr->lang_code_iso_639_3 = 'syr'; $syr->country_code = 'iq'; $syr->wp_locale = 'syr'; $syr->slug = 'syr'; $szl = new GP_Locale(); $szl->english_name = 'Silesian'; $szl->native_name = 'Ślōnskŏ gŏdka'; $szl->lang_code_iso_639_3 = 'szl'; $szl->country_code = 'pl'; $szl->wp_locale = 'szl'; $szl->slug = 'szl'; $szl->nplurals = 3; $szl->plural_expression = '(n==1 ? 0 : n%10>=2 && n%10<=4 && n%100==20 ? 1 : 2)'; $szl->facebook_locale = 'sz_PL'; $ta = new GP_Locale(); $ta->english_name = 'Tamil'; $ta->native_name = 'தமிழ்'; $ta->lang_code_iso_639_1 = 'ta'; $ta->lang_code_iso_639_2 = 'tam'; $ta->country_code = 'in'; $ta->wp_locale = 'ta_IN'; $ta->slug = 'ta'; $ta->google_code = 'ta'; $ta->facebook_locale = 'ta_IN'; $ta_lk = new GP_Locale(); $ta_lk->english_name = 'Tamil (Sri Lanka)'; $ta_lk->native_name = 'தமிழ்'; $ta_lk->lang_code_iso_639_1 = 'ta'; $ta_lk->lang_code_iso_639_2 = 'tam'; $ta_lk->country_code = 'lk'; $ta_lk->wp_locale = 'ta_LK'; $ta_lk->slug = 'ta-lk'; $ta_lk->google_code = 'ta'; $tah = new GP_Locale(); $tah->english_name = 'Tahitian'; $tah->native_name = 'Reo Tahiti'; $tah->lang_code_iso_639_1 = 'ty'; $tah->lang_code_iso_639_2 = 'tah'; $tah->lang_code_iso_639_3 = 'tah'; $tah->country_code = 'fr'; $tah->wp_locale = 'tah'; $tah->slug = 'tah'; $tah->nplurals = 2; $tah->plural_expression = '(n > 1)'; $te = new GP_Locale(); $te->english_name = 'Telugu'; $te->native_name = 'తెలుగు'; $te->lang_code_iso_639_1 = 'te'; $te->lang_code_iso_639_2 = 'tel'; $te->wp_locale = 'te'; $te->slug = 'te'; $te->google_code = 'te'; $te->facebook_locale = 'te_IN'; $tg = new GP_Locale(); $tg->english_name = 'Tajik'; $tg->native_name = 'Тоҷикӣ'; $tg->lang_code_iso_639_1 = 'tg'; $tg->lang_code_iso_639_2 = 'tgk'; $tah->country_code = 'tj'; $tg->wp_locale = 'tg'; $tg->slug = 'tg'; $tg->google_code = 'tg'; $tg->facebook_locale = 'tg_TJ'; $th = new GP_Locale(); $th->english_name = 'Thai'; $th->native_name = 'ไทย'; $th->lang_code_iso_639_1 = 'th'; $th->lang_code_iso_639_2 = 'tha'; $th->wp_locale = 'th'; $th->slug = 'th'; $th->nplurals = 1; $th->plural_expression = '0'; $th->google_code = 'th'; $th->facebook_locale = 'th_TH'; $tir = new GP_Locale(); $tir->english_name = 'Tigrinya'; $tir->native_name = 'ትግርኛ'; $tir->lang_code_iso_639_1 = 'ti'; $tir->lang_code_iso_639_2 = 'tir'; $tir->country_code = 'er'; $tir->wp_locale = 'tir'; $tir->slug = 'tir'; $tir->nplurals = 1; $tir->plural_expression = '0'; $tlh = new GP_Locale(); $tlh->english_name = 'Klingon'; $tlh->native_name = 'TlhIngan'; $tlh->lang_code_iso_639_2 = 'tlh'; $tlh->slug = 'tlh'; $tlh->nplurals = 1; $tlh->plural_expression = '0'; $tlh->facebook_locale = 'tl_ST'; $tl = new GP_Locale(); $tl->english_name = 'Tagalog'; $tl->native_name = 'Tagalog'; $tl->lang_code_iso_639_1 = 'tl'; $tl->lang_code_iso_639_2 = 'tgl'; $tl->country_code = 'ph'; $tl->wp_locale = 'tl'; $tl->slug = 'tl'; $tl->google_code = 'tl'; $tl->facebook_locale = 'tl_PH'; $tr = new GP_Locale(); $tr->english_name = 'Turkish'; $tr->native_name = 'Türkçe'; $tr->lang_code_iso_639_1 = 'tr'; $tr->lang_code_iso_639_2 = 'tur'; $tr->country_code = 'tr'; $tr->wp_locale = 'tr_TR'; $tr->slug = 'tr'; $tr->nplurals = 2; $tr->plural_expression = '(n > 1)'; $tr->google_code = 'tr'; $tr->facebook_locale = 'tr_TR'; $tt_ru = new GP_Locale(); $tt_ru->english_name = 'Tatar'; $tt_ru->native_name = 'Татар теле'; $tt_ru->lang_code_iso_639_1 = 'tt'; $tt_ru->lang_code_iso_639_2 = 'tat'; $tt_ru->country_code = 'ru'; $tt_ru->wp_locale = 'tt_RU'; $tt_ru->slug = 'tt'; $tt_ru->nplurals = 1; $tt_ru->plural_expression = '0'; $tt_ru->facebook_locale = 'tt_RU'; $tuk = new GP_Locale(); $tuk->english_name = 'Turkmen'; $tuk->native_name = 'Türkmençe'; $tuk->lang_code_iso_639_1 = 'tk'; $tuk->lang_code_iso_639_2 = 'tuk'; $tuk->country_code = 'tm'; $tuk->wp_locale = 'tuk'; $tuk->slug = 'tuk'; $tuk->nplurals = 2; $tuk->plural_expression = '(n > 1)'; $tuk->facebook_locale = 'tk_TM'; $twd = new GP_Locale(); $twd->english_name = 'Tweants'; $twd->native_name = 'Twents'; $twd->lang_code_iso_639_3 = 'twd'; $twd->country_code = 'nl'; $twd->wp_locale = 'twd'; $twd->slug = 'twd'; $tzm = new GP_Locale(); $tzm->english_name = 'Tamazight (Central Atlas)'; $tzm->native_name = 'ⵜⴰⵎⴰⵣⵉⵖⵜ'; $tzm->lang_code_iso_639_2 = 'tzm'; $tzm->country_code = 'ma'; $tzm->wp_locale = 'tzm'; $tzm->slug = 'tzm'; $tzm->nplurals = 2; $tzm->plural_expression = '(n > 1)'; $udm = new GP_Locale(); $udm->english_name = 'Udmurt'; $udm->native_name = 'Удмурт кыл'; $udm->lang_code_iso_639_2 = 'udm'; $udm->slug = 'udm'; $ug = new GP_Locale(); $ug->english_name = 'Uighur'; $ug->native_name = 'ئۇيغۇرچە'; $ug->lang_code_iso_639_1 = 'ug'; $ug->lang_code_iso_639_2 = 'uig'; $ug->country_code = 'cn'; $ug->wp_locale = 'ug_CN'; $ug->slug = 'ug'; $ug->text_direction = 'rtl'; $uk = new GP_Locale(); $uk->english_name = 'Ukrainian'; $uk->native_name = 'Українська'; $uk->lang_code_iso_639_1 = 'uk'; $uk->lang_code_iso_639_2 = 'ukr'; $uk->country_code = 'ua'; $uk->wp_locale = 'uk'; $uk->slug = 'uk'; $uk->nplurals = 3; $uk->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $uk->google_code = 'uk'; $uk->facebook_locale = 'uk_UA'; $ur = new GP_Locale(); $ur->english_name = 'Urdu'; $ur->native_name = 'اردو'; $ur->lang_code_iso_639_1 = 'ur'; $ur->lang_code_iso_639_2 = 'urd'; $ur->country_code = 'pk'; $ur->wp_locale = 'ur'; $ur->slug = 'ur'; $ur->text_direction = 'rtl'; $ur->google_code = 'ur'; $ur->facebook_locale = 'ur_PK'; $uz = new GP_Locale(); $uz->english_name = 'Uzbek'; $uz->native_name = 'O‘zbekcha'; $uz->lang_code_iso_639_1 = 'uz'; $uz->lang_code_iso_639_2 = 'uzb'; $uz->country_code = 'uz'; $uz->wp_locale = 'uz_UZ'; $uz->slug = 'uz'; $uz->nplurals = 1; $uz->plural_expression = '0'; $uz->google_code = 'uz'; $uz->facebook_locale = 'uz_UZ'; $vec = new GP_Locale(); $vec->english_name = 'Venetian'; $vec->native_name = 'Vèneta'; $vec->lang_code_iso_639_2 = 'roa'; $vec->lang_code_iso_639_3 = 'vec'; $vec->country_code = 'it'; $vec->slug = 'vec'; $vi = new GP_Locale(); $vi->english_name = 'Vietnamese'; $vi->native_name = 'Tiếng Việt'; $vi->lang_code_iso_639_1 = 'vi'; $vi->lang_code_iso_639_2 = 'vie'; $vi->country_code = 'vn'; $vi->wp_locale = 'vi'; $vi->slug = 'vi'; $vi->nplurals = 1; $vi->plural_expression = '0'; $vi->google_code = 'vi'; $vi->facebook_locale = 'vi_VN'; $wa = new GP_Locale(); $wa->english_name = 'Walloon'; $wa->native_name = 'Walon'; $wa->lang_code_iso_639_1 = 'wa'; $wa->lang_code_iso_639_2 = 'wln'; $wa->country_code = 'be'; $wa->wp_locale = 'wa'; $wa->slug = 'wa'; $xho = new GP_Locale(); $xho->english_name = 'Xhosa'; $xho->native_name = 'isiXhosa'; $xho->lang_code_iso_639_1 = 'xh'; $xho->lang_code_iso_639_2 = 'xho'; $xho->lang_code_iso_639_3 = 'xho'; $xho->country_code = 'za'; $xho->wp_locale = 'xho'; $xho->slug = 'xho'; $xho->google_code = 'xh'; $xho->facebook_locale = 'xh_ZA'; $xmf = new GP_Locale(); $xmf->english_name = 'Mingrelian'; $xmf->native_name = 'მარგალური ნინა'; $xmf->lang_code_iso_639_3 = 'xmf'; $xmf->country_code = 'ge'; $xmf->wp_locale = 'xmf'; $xmf->slug = 'xmf'; $yi = new GP_Locale(); $yi->english_name = 'Yiddish'; $yi->native_name = 'ייִדיש'; $yi->lang_code_iso_639_1 = 'yi'; $yi->lang_code_iso_639_2 = 'yid'; $yi->slug = 'yi'; $yi->text_direction = 'rtl'; $yi->google_code = 'yi'; $yor = new GP_Locale(); $yor->english_name = 'Yoruba'; $yor->native_name = 'Yorùbá'; $yor->lang_code_iso_639_1 = 'yo'; $yor->lang_code_iso_639_2 = 'yor'; $yor->lang_code_iso_639_3 = 'yor'; $yor->country_code = 'ng'; $yor->wp_locale = 'yor'; $yor->slug = 'yor'; $yor->google_code = 'yo'; $yor->facebook_locale = 'yo_NG'; $zh_cn = new GP_Locale(); $zh_cn->english_name = 'Chinese (China)'; $zh_cn->native_name = '简体中文'; $zh_cn->lang_code_iso_639_1 = 'zh'; $zh_cn->lang_code_iso_639_2 = 'zho'; $zh_cn->country_code = 'cn'; $zh_cn->wp_locale = 'zh_CN'; $zh_cn->slug = 'zh-cn'; $zh_cn->nplurals = 1; $zh_cn->plural_expression = '0'; $zh_cn->google_code = 'zh-CN'; $zh_cn->facebook_locale = 'zh_CN'; $zh_hk = new GP_Locale(); $zh_hk->english_name = 'Chinese (Hong Kong)'; $zh_hk->native_name = '香港中文版 '; $zh_hk->lang_code_iso_639_1 = 'zh'; $zh_hk->lang_code_iso_639_2 = 'zho'; $zh_hk->country_code = 'hk'; $zh_hk->wp_locale = 'zh_HK'; $zh_hk->slug = 'zh-hk'; $zh_hk->nplurals = 1; $zh_hk->plural_expression = '0'; $zh_hk->facebook_locale = 'zh_HK'; $zh_sg = new GP_Locale(); $zh_sg->english_name = 'Chinese (Singapore)'; $zh_sg->native_name = '中文'; $zh_sg->lang_code_iso_639_1 = 'zh'; $zh_sg->lang_code_iso_639_2 = 'zho'; $zh_sg->country_code = 'sg'; $zh_sg->wp_locale = 'zh_SG'; $zh_sg->slug = 'zh-sg'; $zh_sg->nplurals = 1; $zh_sg->plural_expression = '0'; $zh_tw = new GP_Locale(); $zh_tw->english_name = 'Chinese (Taiwan)'; $zh_tw->native_name = '繁體中文'; $zh_tw->lang_code_iso_639_1 = 'zh'; $zh_tw->lang_code_iso_639_2 = 'zho'; $zh_tw->country_code = 'tw'; $zh_tw->slug = 'zh-tw'; $zh_tw->wp_locale= 'zh_TW'; $zh_tw->nplurals = 1; $zh_tw->plural_expression = '0'; $zh_tw->google_code = 'zh-TW'; $zh_tw->facebook_locale = 'zh_TW'; $zh = new GP_Locale(); $zh->english_name = 'Chinese'; $zh->native_name = '中文'; $zh->lang_code_iso_639_1 = 'zh'; $zh->lang_code_iso_639_2 = 'zho'; $zh->slug = 'zh'; $zh->nplurals = 1; $zh->plural_expression = '0'; $zul = new GP_Locale(); $zul->english_name = 'Zulu'; $zul->native_name = 'isiZulu'; $zul->lang_code_iso_639_1 = 'zu'; $zul->lang_code_iso_639_2 = 'zul'; $zul->lang_code_iso_639_3 = 'zul'; $zul->country_code = 'za'; $zul->wp_locale = 'zul'; $zul->slug = 'zul'; $zul->google_code = 'zu'; foreach( get_defined_vars() as $locale ) { $this->locales[ $locale->slug ] = $locale; } } public static function &instance() { if ( ! isset( $GLOBALS['gp_locales'] ) ) $GLOBALS['gp_locales'] = new GP_Locales; return $GLOBALS['gp_locales']; } public static function locales() { $instance = GP_Locales::instance(); return $instance->locales; } public static function exists( $slug ) { $instance = GP_Locales::instance(); return isset( $instance->locales[ $slug ] ); } public static function by_slug( $slug ) { $instance = GP_Locales::instance(); return isset( $instance->locales[ $slug ] )? $instance->locales[ $slug ] : null; } public static function by_field( $field_name, $field_value ) { $instance = GP_Locales::instance(); $result = false; foreach( $instance->locales() as $locale ) { if ( isset( $locale->$field_name ) && $locale->$field_name == $field_value ) { $result = $locale; break; } } return $result; } } endif;