aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-05-11 10:45:31 +0000
committerRomain d'Alverny <rda@mageia.org>2012-05-11 10:45:31 +0000
commit611c8e117f4432c0b4fd744cc907aaed5b0662b5 (patch)
tree509c047158e151f45cd71e6dfec80b8e3ca1e9c2
parent113c57e2a640e11f53b2f20968ba1bb99f132c4f (diff)
downloadwww-611c8e117f4432c0b4fd744cc907aaed5b0662b5.tar
www-611c8e117f4432c0b4fd744cc907aaed5b0662b5.tar.gz
www-611c8e117f4432c0b4fd744cc907aaed5b0662b5.tar.bz2
www-611c8e117f4432c0b4fd744cc907aaed5b0662b5.tar.xz
www-611c8e117f4432c0b4fd744cc907aaed5b0662b5.zip
show localized country/city names
-rw-r--r--en/downloads/get/lib.php33
1 files changed, 28 insertions, 5 deletions
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;
}