diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-02-10 06:12:16 +0000 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-02-10 06:12:16 +0000 |
commit | b2f20ff76649cab714c761e8a43f66e1976cf3d4 (patch) | |
tree | 5974be43528c46f8074e9390399fc92648eeb3fb /core/helpers | |
parent | fc162362de2f155933baf3231a857faa9f6d46cc (diff) |
style fixes (style for method names, style for vars in locale.php)
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/locale.php | 207 |
1 files changed, 103 insertions, 104 deletions
diff --git a/core/helpers/locale.php b/core/helpers/locale.php index 592f73b3..bd85cf6b 100644 --- a/core/helpers/locale.php +++ b/core/helpers/locale.php @@ -25,10 +25,10 @@ class locale_Core { /** * Return the list of available locales. */ - public static function available() { + static function available() { $locales = array(); - list ($supportedLanguages, $defaultCountry) = self::getLanguageData(); - foreach ($supportedLanguages as $language_tag => $country_locales) { + list ($supported_languages, $default_Country) = self::_get_language_data(); + foreach ($supported_languages as $language_tag => $country_locales) { foreach ($country_locales as $country_tag => $entry) { $locales[$language_tag . '_' . $country_tag] = $entry['description']; @@ -38,177 +38,176 @@ class locale_Core { return $locales; } - private static function getLanguageData() { - static $supportedLanguages = array(); - static $defaultCountry = array(); + private static function _get_language_data() { + static $supported_languages = array(); + static $default_country = array(); // TODO(andy_st): Might want to add a localizable language name as well. - if (empty($supportedLanguages)) { + if (empty($supported_languages)) { /* English */ - $supportedLanguages['en']['US']['description'] = 'English (US)'; - $supportedLanguages['en']['GB']['description'] = 'English (UK)'; - $defaultCountry['en'] = 'US'; + $supported_languages['en']['US']['description'] = 'English (US)'; + $supported_languages['en']['GB']['description'] = 'English (UK)'; + $default_country['en'] = 'US'; /* Afrikaans */ - $supportedLanguages['af']['ZA']['description'] = 'Afrikaans'; - $defaultCountry['af'] = 'ZA'; + $supported_languages['af']['ZA']['description'] = 'Afrikaans'; + $default_country['af'] = 'ZA'; /* Catalan */ - $supportedLanguages['ca']['ES']['description'] = 'Catalan'; - $defaultCountry['ca'] = 'ES'; + $supported_languages['ca']['ES']['description'] = 'Catalan'; + $default_country['ca'] = 'ES'; /* Czech */ - $supportedLanguages['cs']['CZ']['description'] = 'Česky'; - $defaultCountry['cs'] = 'CZ'; - + $supported_languages['cs']['CZ']['description'] = 'Česky'; + $default_country['cs'] = 'CZ'; + /* Danish */ - $supportedLanguages['da']['DK']['description'] = 'Dansk'; - $defaultCountry['da'] = 'DK'; - + $supported_languages['da']['DK']['description'] = 'Dansk'; + $default_country['da'] = 'DK'; + /* German */ - $supportedLanguages['de']['DE']['description'] = 'Deutsch'; - $defaultCountry['de'] = 'DE'; + $supported_languages['de']['DE']['description'] = 'Deutsch'; + $default_country['de'] = 'DE'; /* Spanish */ - $supportedLanguages['es']['ES']['description'] = 'Español'; - $supportedLanguages['es']['MX']['description'] = 'Español (MX)'; - $supportedLanguages['es']['AR']['description'] = 'Español (AR)'; - $defaultCountry['es'] = 'ES'; + $supported_languages['es']['ES']['description'] = 'Español'; + $supported_languages['es']['MX']['description'] = 'Español (MX)'; + $supported_languages['es']['AR']['description'] = 'Español (AR)'; + $default_country['es'] = 'ES'; /* Estonian */ - $supportedLanguages['et']['EE']['description'] = 'Eesti'; - $defaultCountry['et'] = 'EE'; + $supported_languages['et']['EE']['description'] = 'Eesti'; + $default_country['et'] = 'EE'; /* Basque */ - $supportedLanguages['eu']['ES']['description'] = 'Euskara'; - $defaultCountry['eu'] = 'ES'; + $supported_languages['eu']['ES']['description'] = 'Euskara'; + $default_country['eu'] = 'ES'; /* French */ - $supportedLanguages['fr']['FR']['description'] = 'Français'; - $defaultCountry['fr'] = 'FR'; - + $supported_languages['fr']['FR']['description'] = 'Français'; + $default_country['fr'] = 'FR'; + /* Irish */ - $supportedLanguages['ga']['IE']['description'] = 'Gaeilge'; - $defaultCountry['ga'] = 'IE'; - + $supported_languages['ga']['IE']['description'] = 'Gaeilge'; + $default_country['ga'] = 'IE'; + /* Greek */ - $supportedLanguages['el']['GR']['description'] = 'Greek'; - $defaultCountry['el'] = 'GR'; - - /* Icelandic */ - $supportedLanguages['is']['IS']['description'] = 'Icelandic'; - $defaultCountry['is'] = 'IS'; + $supported_languages['el']['GR']['description'] = 'Greek'; + $default_country['el'] = 'GR'; + /* Icelandic */ + $supported_languages['is']['IS']['description'] = 'Icelandic'; + $default_country['is'] = 'IS'; /* Italian */ - $supportedLanguages['it']['IT']['description'] = 'Italiano'; - $defaultCountry['it'] = 'IT'; + $supported_languages['it']['IT']['description'] = 'Italiano'; + $default_country['it'] = 'IT'; /* Latvian */ - $supportedLanguages['lv']['LV']['description'] = 'Latviešu'; - $defaultCountry['lv'] = 'LV'; + $supported_languages['lv']['LV']['description'] = 'Latviešu'; + $default_country['lv'] = 'LV'; /* Lithuanian */ - $supportedLanguages['lt']['LT']['description'] = 'Lietuvių'; - $defaultCountry['lt'] = 'LT'; + $supported_languages['lt']['LT']['description'] = 'Lietuvių'; + $default_country['lt'] = 'LT'; /* Hungarian */ - $supportedLanguages['hu']['HU']['description'] = 'Magyar'; - $defaultCountry['hu'] = 'HU'; + $supported_languages['hu']['HU']['description'] = 'Magyar'; + $default_country['hu'] = 'HU'; /* Dutch */ - $supportedLanguages['nl']['NL']['description'] = 'Nederlands'; - $defaultCountry['nl'] = 'NL'; + $supported_languages['nl']['NL']['description'] = 'Nederlands'; + $default_country['nl'] = 'NL'; /* Norwegian */ - $supportedLanguages['no']['NO']['description'] = 'Norsk bokmål'; - $defaultCountry['no'] = 'NO'; - + $supported_languages['no']['NO']['description'] = 'Norsk bokmål'; + $default_country['no'] = 'NO'; + /* Polish */ - $supportedLanguages['pl']['PL']['description'] = 'Polski'; - $defaultCountry['pl'] = 'PL'; - + $supported_languages['pl']['PL']['description'] = 'Polski'; + $default_country['pl'] = 'PL'; + /* Portuguese */ - $supportedLanguages['pt']['BR']['description'] = 'Português Brasileiro'; - $supportedLanguages['pt']['PT']['description'] = 'Português'; - $defaultCountry['pt'] = 'PT'; + $supported_languages['pt']['BR']['description'] = 'Português Brasileiro'; + $supported_languages['pt']['PT']['description'] = 'Português'; + $default_country['pt'] = 'PT'; /* Romanian */ - $supportedLanguages['ro']['RO']['description'] = 'Română'; - $defaultCountry['ro'] = 'RO'; + $supported_languages['ro']['RO']['description'] = 'Română'; + $default_country['ro'] = 'RO'; /* Slovak */ - $supportedLanguages['sk']['SK']['description'] = 'Slovenčina'; - $defaultCountry['sk'] = 'SK'; + $supported_languages['sk']['SK']['description'] = 'Slovenčina'; + $default_country['sk'] = 'SK'; /* Slovenian */ - $supportedLanguages['sl']['SI']['description'] = 'Slovenščina'; - $defaultCountry['sl'] = 'SI'; + $supported_languages['sl']['SI']['description'] = 'Slovenščina'; + $default_country['sl'] = 'SI'; /* Serbian */ - $supportedLanguages['sr']['CS']['description'] = 'Srpski'; - $defaultCountry['sr'] = 'CS'; + $supported_languages['sr']['CS']['description'] = 'Srpski'; + $default_country['sr'] = 'CS'; /* Finnish */ - $supportedLanguages['fi']['FI']['description'] = 'Suomi'; - $defaultCountry['fi'] = 'FI'; + $supported_languages['fi']['FI']['description'] = 'Suomi'; + $default_country['fi'] = 'FI'; /* Swedish */ - $supportedLanguages['sv']['SE']['description'] = 'Svenska'; - $defaultCountry['sv'] = 'SE'; + $supported_languages['sv']['SE']['description'] = 'Svenska'; + $default_country['sv'] = 'SE'; /* Ukrainian */ - $supportedLanguages['uk']['UA']['description'] = 'УкÑаÑнÑÑка'; - $defaultCountry['uk'] = 'UA'; - + $supported_languages['uk']['UA']['description'] = 'УкÑаÑнÑÑка'; + $default_country['uk'] = 'UA'; + /* Vietnamese */ - $supportedLanguages['vi']['VN']['description'] = 'Tiếng Việt'; - $defaultCountry['vi'] = 'VN'; + $supported_languages['vi']['VN']['description'] = 'Tiếng Việt'; + $default_country['vi'] = 'VN'; /* Turkish */ - $supportedLanguages['tr']['TR']['description'] = 'Türkçe'; - $defaultCountry['tr'] = 'TR'; + $supported_languages['tr']['TR']['description'] = 'Türkçe'; + $default_country['tr'] = 'TR'; /* Bulgarian */ - $supportedLanguages['bg']['BG']['description'] = + $supported_languages['bg']['BG']['description'] = 'Български'; - $defaultCountry['bg'] = 'BG'; + $default_country['bg'] = 'BG'; /* Russian */ - $supportedLanguages['ru']['RU']['description'] = + $supported_languages['ru']['RU']['description'] = 'Русский'; - $defaultCountry['ru'] = 'RU'; + $default_country['ru'] = 'RU'; /* Chinese */ - $supportedLanguages['zh']['CN']['description'] = '简体中文'; - $supportedLanguages['zh']['TW']['description'] = '繁體中文'; - $defaultCountry['zh'] = 'CN'; - + $supported_languages['zh']['CN']['description'] = '简体中文'; + $supported_languages['zh']['TW']['description'] = '繁體中文'; + $default_country['zh'] = 'CN'; + /* Korean */ - $supportedLanguages['ko']['KR']['description'] = '한국말'; - $defaultCountry['ko'] = 'KR'; + $supported_languages['ko']['KR']['description'] = '한국말'; + $default_country['ko'] = 'KR'; /* Japanese */ - $supportedLanguages['ja']['JP']['description'] = '日本語'; - $defaultCountry['ja'] = 'JP'; + $supported_languages['ja']['JP']['description'] = '日本語'; + $default_country['ja'] = 'JP'; /* Arabic */ - $supportedLanguages['ar']['SA']['description'] = + $supported_languages['ar']['SA']['description'] = 'العربية'; - $supportedLanguages['ar']['SA']['right-to-left'] = true; - $defaultCountry['ar'] = 'SA'; + $supported_languages['ar']['SA']['right-to-left'] = true; + $default_country['ar'] = 'SA'; /* Hebrew */ - $supportedLanguages['he']['IL']['description'] = 'עברית'; - $supportedLanguages['he']['IL']['right-to-left'] = true; - $defaultCountry['he'] = 'IL'; - + $supported_languages['he']['IL']['description'] = 'עברית'; + $supported_languages['he']['IL']['right-to-left'] = true; + $default_country['he'] = 'IL'; + /* Farsi */ - $supportedLanguages['fa']['IR']['description'] = 'فارسي'; - $supportedLanguages['fa']['IR']['right-to-left'] = true; - $defaultCountry['fa'] = 'IR'; + $supported_languages['fa']['IR']['description'] = 'فارسي'; + $supported_languages['fa']['IR']['right-to-left'] = true; + $default_country['fa'] = 'IR'; } - return array($supportedLanguages, $defaultCountry); + return array($supported_languages, $default_country); } -} +}
\ No newline at end of file |