mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-30 16:29:10 -04:00
213 lines
7.3 KiB
PHP
213 lines
7.3 KiB
PHP
<?php defined("SYSPATH") or die("No direct script access.");
|
|
/**
|
|
* Gallery - a web based photo album viewer and editor
|
|
* Copyright (C) 2000-2008 Bharat Mediratta
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
* your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
/**
|
|
* This is the API for handling locales.
|
|
*/
|
|
class locale_Core {
|
|
/**
|
|
* Return the list of available locales.
|
|
*/
|
|
static function available() {
|
|
$locales = array();
|
|
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'];
|
|
}
|
|
}
|
|
|
|
return $locales;
|
|
}
|
|
|
|
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($supported_languages)) {
|
|
/* English */
|
|
$supported_languages['en']['US']['description'] = 'English (US)';
|
|
$supported_languages['en']['GB']['description'] = 'English (UK)';
|
|
$default_country['en'] = 'US';
|
|
|
|
/* Afrikaans */
|
|
$supported_languages['af']['ZA']['description'] = 'Afrikaans';
|
|
$default_country['af'] = 'ZA';
|
|
|
|
/* Catalan */
|
|
$supported_languages['ca']['ES']['description'] = 'Catalan';
|
|
$default_country['ca'] = 'ES';
|
|
|
|
/* Czech */
|
|
$supported_languages['cs']['CZ']['description'] = 'Česky';
|
|
$default_country['cs'] = 'CZ';
|
|
|
|
/* Danish */
|
|
$supported_languages['da']['DK']['description'] = 'Dansk';
|
|
$default_country['da'] = 'DK';
|
|
|
|
/* German */
|
|
$supported_languages['de']['DE']['description'] = 'Deutsch';
|
|
$default_country['de'] = 'DE';
|
|
|
|
/* Spanish */
|
|
$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 */
|
|
$supported_languages['et']['EE']['description'] = 'Eesti';
|
|
$default_country['et'] = 'EE';
|
|
|
|
/* Basque */
|
|
$supported_languages['eu']['ES']['description'] = 'Euskara';
|
|
$default_country['eu'] = 'ES';
|
|
|
|
/* French */
|
|
$supported_languages['fr']['FR']['description'] = 'Français';
|
|
$default_country['fr'] = 'FR';
|
|
|
|
/* Irish */
|
|
$supported_languages['ga']['IE']['description'] = 'Gaeilge';
|
|
$default_country['ga'] = 'IE';
|
|
|
|
/* Greek */
|
|
$supported_languages['el']['GR']['description'] = 'Greek';
|
|
$default_country['el'] = 'GR';
|
|
|
|
/* Icelandic */
|
|
$supported_languages['is']['IS']['description'] = 'Icelandic';
|
|
$default_country['is'] = 'IS';
|
|
|
|
/* Italian */
|
|
$supported_languages['it']['IT']['description'] = 'Italiano';
|
|
$default_country['it'] = 'IT';
|
|
|
|
/* Latvian */
|
|
$supported_languages['lv']['LV']['description'] = 'Latviešu';
|
|
$default_country['lv'] = 'LV';
|
|
|
|
/* Lithuanian */
|
|
$supported_languages['lt']['LT']['description'] = 'Lietuvių';
|
|
$default_country['lt'] = 'LT';
|
|
|
|
/* Hungarian */
|
|
$supported_languages['hu']['HU']['description'] = 'Magyar';
|
|
$default_country['hu'] = 'HU';
|
|
|
|
/* Dutch */
|
|
$supported_languages['nl']['NL']['description'] = 'Nederlands';
|
|
$default_country['nl'] = 'NL';
|
|
|
|
/* Norwegian */
|
|
$supported_languages['no']['NO']['description'] = 'Norsk bokmål';
|
|
$default_country['no'] = 'NO';
|
|
|
|
/* Polish */
|
|
$supported_languages['pl']['PL']['description'] = 'Polski';
|
|
$default_country['pl'] = 'PL';
|
|
|
|
/* Portuguese */
|
|
$supported_languages['pt']['BR']['description'] = 'Português Brasileiro';
|
|
$supported_languages['pt']['PT']['description'] = 'Português';
|
|
$default_country['pt'] = 'PT';
|
|
|
|
/* Romanian */
|
|
$supported_languages['ro']['RO']['description'] = 'Română';
|
|
$default_country['ro'] = 'RO';
|
|
|
|
/* Slovak */
|
|
$supported_languages['sk']['SK']['description'] = 'Slovenčina';
|
|
$default_country['sk'] = 'SK';
|
|
|
|
/* Slovenian */
|
|
$supported_languages['sl']['SI']['description'] = 'Slovenščina';
|
|
$default_country['sl'] = 'SI';
|
|
|
|
/* Serbian */
|
|
$supported_languages['sr']['CS']['description'] = 'Srpski';
|
|
$default_country['sr'] = 'CS';
|
|
|
|
/* Finnish */
|
|
$supported_languages['fi']['FI']['description'] = 'Suomi';
|
|
$default_country['fi'] = 'FI';
|
|
|
|
/* Swedish */
|
|
$supported_languages['sv']['SE']['description'] = 'Svenska';
|
|
$default_country['sv'] = 'SE';
|
|
|
|
/* Ukrainian */
|
|
$supported_languages['uk']['UA']['description'] = 'УкÑаÑнÑÑка';
|
|
$default_country['uk'] = 'UA';
|
|
|
|
/* Vietnamese */
|
|
$supported_languages['vi']['VN']['description'] = 'Tiếng Việt';
|
|
$default_country['vi'] = 'VN';
|
|
|
|
/* Turkish */
|
|
$supported_languages['tr']['TR']['description'] = 'Türkçe';
|
|
$default_country['tr'] = 'TR';
|
|
|
|
/* Bulgarian */
|
|
$supported_languages['bg']['BG']['description'] =
|
|
'Български';
|
|
$default_country['bg'] = 'BG';
|
|
|
|
/* Russian */
|
|
$supported_languages['ru']['RU']['description'] =
|
|
'Русский';
|
|
$default_country['ru'] = 'RU';
|
|
|
|
/* Chinese */
|
|
$supported_languages['zh']['CN']['description'] = '简体中文';
|
|
$supported_languages['zh']['TW']['description'] = '繁體中文';
|
|
$default_country['zh'] = 'CN';
|
|
|
|
/* Korean */
|
|
$supported_languages['ko']['KR']['description'] = '한국말';
|
|
$default_country['ko'] = 'KR';
|
|
|
|
/* Japanese */
|
|
$supported_languages['ja']['JP']['description'] = '日本語';
|
|
$default_country['ja'] = 'JP';
|
|
|
|
/* Arabic */
|
|
$supported_languages['ar']['SA']['description'] =
|
|
'العربية';
|
|
$supported_languages['ar']['SA']['right-to-left'] = true;
|
|
$default_country['ar'] = 'SA';
|
|
|
|
/* Hebrew */
|
|
$supported_languages['he']['IL']['description'] = 'עברית';
|
|
$supported_languages['he']['IL']['right-to-left'] = true;
|
|
$default_country['he'] = 'IL';
|
|
|
|
/* Farsi */
|
|
$supported_languages['fa']['IR']['description'] = 'فارسي';
|
|
$supported_languages['fa']['IR']['right-to-left'] = true;
|
|
$default_country['fa'] = 'IR';
|
|
}
|
|
|
|
return array($supported_languages, $default_country);
|
|
}
|
|
} |