diff options
author | filip <filip.komar@gmail.com> | 2020-05-06 19:14:42 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2020-05-06 19:14:42 +0200 |
commit | dc9e76731b08732fd110fb80b874907704a984b6 (patch) | |
tree | 835f60c48a635a5f4ccb62e5d4d6671827d7e9df /en/downloads/get/lib.php | |
parent | baa9325189ff28b4508068c4ac0db10712b0c58b (diff) | |
download | www-dc9e76731b08732fd110fb80b874907704a984b6.tar www-dc9e76731b08732fd110fb80b874907704a984b6.tar.gz www-dc9e76731b08732fd110fb80b874907704a984b6.tar.bz2 www-dc9e76731b08732fd110fb80b874907704a984b6.tar.xz www-dc9e76731b08732fd110fb80b874907704a984b6.zip |
finally i18n countries and cities in DL page + update infrastructure for that
Diffstat (limited to 'en/downloads/get/lib.php')
-rw-r--r-- | en/downloads/get/lib.php | 136 |
1 files changed, 87 insertions, 49 deletions
diff --git a/en/downloads/get/lib.php b/en/downloads/get/lib.php index 7f720cb08..a479a1f91 100644 --- a/en/downloads/get/lib.php +++ b/en/downloads/get/lib.php @@ -9,46 +9,93 @@ * @link http://www.mageia.org/ * */ -// _r(''); // note, we use geographical country names -$countries = array( - 'AR' => 'Argentina', - 'AU' => 'Australia', - 'BE' => 'Belgique', - 'BG' => 'България - Bulgaria', - 'BR' => 'Brasil', - 'BY' => 'Беларусь - Belarus', - 'CA' => 'Canada', - 'CH' => 'Switzerland', - 'CN' => '中国 - China', - 'CZ' => 'Česko', // Czechia - 'DE' => 'Deutschland', - 'DK' => 'Danmark', - 'EC' => 'Ecuador', - 'ES' => 'España', - 'FR' => 'France', - 'GB' => 'Great Britain', - 'GR' => 'Ελλάδα - Greece', - 'GT' => 'Guatemala', - 'ID' => 'Indonesia', - 'IL' => 'Israel', - 'IT' => 'Italia', - 'JP' => '日本国 - Japan', - 'NC' => 'Nouvelle-Calédonie', - 'NL' => 'Nederlands', - 'PH' => 'Philipines', - 'PL' => 'Polska', - 'RU' => 'Россия - Russia', - 'SE' => 'Sverige', - 'TR' => 'Türkiye', - 'TW' => '臺灣 - Taiwan', - 'UA' => 'Ukraine', - 'UK' => 'the UK', - 'US' => 'the USA', - 'VN' => 'Vietnam', - 'ZA' => 'South Africa' +$countries = array ( + 'AR' => _r("Argentina"), + 'AU' => _r("Australia"), + 'BE' => _r("Belgique"), + 'BG' => _r("България - Bulgaria"), + 'BR' => _r("Brasil"), + 'BY' => _r("Беларусь - Belarus"), + 'CA' => _r("Canada"), + 'CH' => _r("Switzerland"), + 'CN' => _r("中国 - China"), + 'CZ' => _r("Česko"), + 'DE' => _r("Deutschland"), + 'DK' => _r("Danmark"), + 'EC' => _r("Ecuador"), + 'ES' => _r("España"), + 'FR' => _r("France"), + 'GB' => _r("Great Britain"), + 'GR' => _r("Ελλάδα - Greece"), + 'GT' => _r("Guatemala"), + 'HU' => _r("Hungary"), + 'ID' => _r("Indonesia"), + 'IL' => _r("Israel"), + 'IT' => _r("Italia"), + 'JP' => _r("日本国 - Japan"), + 'NC' => _r("Nouvelle-Calédonie"), + 'NL' => _r("Nederlands"), + 'PH' => _r("Philipines"), + 'PL' => _r("Polska"), + 'RU' => _r("Россия - Russia"), + 'SE' => _r("Sverige"), + 'TR' => _r("Türkiye"), + 'TW' => _r("臺灣 - Taiwan"), + 'UA' => _r("Ukraine"), + 'UK' => _r("the UK"), + 'US' => _r("the USA"), + 'VN' => _r("Vietnam"), + 'ZA' => _r("South Africa"), ); +$cities_i18n = array ( + 'Adelaide' => _r("Adelaide"), + 'Amsterdam' => _r("Amsterdam"), + 'Ankara' => _r("Ankara"), + 'Beauharnois' => _r("Beauharnois"), + 'Beijing' => _r("Beijing"), // '北京', // .cn + 'Brasilia' => _r("Brasilia"), + 'Brisbane' => _r("Brisbane"), + 'Brno' => _r("Brno"), + 'Brussels' => _r("Brussels"), + 'Canterbury' => _r("Canterbury"), + 'Cebu' => _r("Cebu"), + 'Chungli' => _r("Chungli"), + 'Cuenca' => _r("Cuenca"), + 'DTU' => _r("DTU"), + 'Durham' => _r("Durham"), + 'Düsseldorf' => _r("Düsseldorf"), + 'Enschede' => _r("Enschede"), + 'Erlangen' => _r("Erlangen"), + 'Falkenstein/Vogtl.' => _r("Falkenstein/Vogtl."), + 'Göttingen' => _r("Göttingen"), + 'Heraklion' => _r("Heraklion"), // 'Ηράκλειο', // .gr + 'HsinChu' => _r("HsinChu"), // '新竹市', // .tw + 'Lenoir' => _r("Lenoir"), + 'Lyon' => _r("Lyon"), + 'Milan' => _r("Milan"), + 'Minsk' => _r("Minsk"), // 'Мінск', // .by + 'Miskolc' => _r("Miskolc"), + 'Moscow' => _r("Moscow"), // 'Москва', // .ru + 'Paris' => _r("Paris"), + 'Prague' => _r("Prague"), // 'Praha', // .cz + 'Princeton' => _r("Princeton"), + 'Schneverdingen' => _r("Schneverdingen"), + 'Shanghai' => _r("Shanghai"), + 'Sofia' => _r("Sofia"), + 'Stellenbosch' => _r("Stellenbosch"), + 'Taipei' => _r("Taipei"), + 'Tsukuba' => _r("Tsukuba"), + 'Umeå' => _r("Umeå"), + 'Vinnytsia' => _r("Vinnytsia"), + 'Warszawa' => _r("Warszawa"), + 'Yonezawa' => _r("Yonezawa"), // '米沢市', // .jp + 'ruchmond' => _r("ruchmond"), + 'Краснодар' => _r("Краснодар"), +); + + /** * Rewrite city name in the local official language. * @@ -56,19 +103,10 @@ $countries = array( * * @return string */ -function rewrite_city($name) +function rewrite_city($name, $cities_for_rewrite) { - $cities = array( - 'HsinChu' => '新竹市', // .tw - 'Yonezawa' => '米沢市', // .jp - 'Beijing' => '北京', // .cn - 'Moscow' => 'Москва', // .ru - 'Minsk' => 'Мінск', // .by - 'Heraklion' => 'Ηράκλειο', // .gr - 'Prague' => 'Praha', // .cz - ); - if (array_key_exists($name, $cities)) { - return $cities[$name]; + if (array_key_exists($name, $cities_for_rewrite)) { + return $cities_for_rewrite[$name]; } return $name; |