From 611c8e117f4432c0b4fd744cc907aaed5b0662b5 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Fri, 11 May 2012 10:45:31 +0000 Subject: show localized country/city names --- en/downloads/get/lib.php | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'en') diff --git a/en/downloads/get/lib.php b/en/downloads/get/lib.php index bcafa8b56..5217153f0 100644 --- a/en/downloads/get/lib.php +++ b/en/downloads/get/lib.php @@ -2,6 +2,7 @@ /** */ +// note, we use geographical country names $countries = array( 'AU' => 'Australia', 'BE' => 'Belgique', @@ -9,26 +10,48 @@ $countries = array( 'BY' => 'Беларусь', // Belarus 'CA' => 'Canada', 'CH' => 'Switzerland', - 'CN' => 'China', - 'CZ' => 'Czechia', + 'CN' => '中国', // China + 'CZ' => 'Česko', // Czechia 'DE' => 'Deutschland', 'ES' => 'España', 'FR' => 'France', - 'GR' => 'Greece', + 'GR' => 'Ελλάδα', // Greece 'GT' => 'Guatemala', 'ID' => 'Indonesia', 'IT' => 'Italia', - 'JP' => 'Japan', + 'JP' => '日本国', // Japan 'NC' => 'Nouvelle-Calédonie', 'NL' => 'Nederlands', 'PL' => 'Polska', 'RU' => 'Россия', 'SE' => 'Sverige', - 'TW' => 'Taiwan', + 'TW' => '臺灣', // Taiwan 'UK' => 'the UK', 'US' => 'the USA', ); +/** + * Rewrite city name in the local official language. + * @param string + * @return string +*/ +function rewrite_city($name) +{ + $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]; + + return $name; +} + function get($s) { return isset($_GET[$s]) ? trim($_GET[$s]) : null; } -- cgit v1.2.1