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/index.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/index.php')
-rw-r--r-- | en/downloads/get/index.php | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index 3ec90ebd2..add253c0f 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -33,9 +33,14 @@ * */ -require 'lib.php'; require_once '../../../lib/mga_geoip.php'; +define('HLANG', true); +define('ALIGNMENT', 'Center'); +require '../../../langs.php'; +$dictionary = read_translation_file($locale, array('downloads/get', 'common_footer')); +require 'lib.php'; + // request $product = get('q'); $doc = get('doc'); @@ -44,17 +49,11 @@ if (isset($_GET['torrent'])) { $torrent = strip_tags(trim($_GET['torrent'])); } $torrent = isset($torrent) ? true : false; - if (is_null($product)) { header('Location: /downloads/'); die; } -define('HLANG', true); -define('ALIGNMENT', 'Center'); -require '../../../langs.php'; -$dictionary = read_translation_file($locale, array('downloads/get', 'common_footer')); - session_start(); $download = null; @@ -126,7 +125,12 @@ try { $alt_dl_link, strtoupper($pm['scheme']), $pm['host'] ); } - $s[] = sprintf('<td>%s</td><td>%s</td>', rewrite_city($city), implode(', ', $mirs)); + if ("-" == $city) { + $city = _r("City not set"); + } + $s[] = sprintf('<td>%s</td><td>%s</td>', + (isset($cities_i18n[$city])) ? $cities_i18n[$city] : $city, + implode(', ', $mirs)); } $alternative_mirrors .= sprintf('<tr><td rowspan="%d">%s</td>%s</tr>' . PHP_EOL, count($cities), $country, implode('</tr><tr>', $s)); } @@ -143,8 +147,8 @@ try { _r('This <a href="%s">%s</a> download mirror is located in %s (%s).', ' '), $one_mirror['mirror_url'], $one_mirror['mirror_host'], - rewrite_city($one_mirror['city']), - $mirrors_country_name + ("-" == $one_mirror['city']) ? $mirrors_country_name : $one_mirror['city'], + ("-" == $one_mirror['city']) ? _r("City not set") : $mirrors_country_name ); $dl2_mirror_alt .= _r('If it does not work well for you, <a href="#om" id="other_mirrors_btn">check out these other mirrors</a>.', ' '); if (array_key_exists($_SESSION['country'], $countries)) { |