diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-06-10 17:40:32 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-06-10 17:40:32 +0000 |
commit | 6af939fa66141895f6751a6a83a2439306d9009d (patch) | |
tree | aee2ea1395460b19778e98a1282947663c88a598 /en | |
parent | 6cc0ccf643a2262cccd54273e860eb791fe627a4 (diff) | |
download | www-6af939fa66141895f6751a6a83a2439306d9009d.tar www-6af939fa66141895f6751a6a83a2439306d9009d.tar.gz www-6af939fa66141895f6751a6a83a2439306d9009d.tar.bz2 www-6af939fa66141895f6751a6a83a2439306d9009d.tar.xz www-6af939fa66141895f6751a6a83a2439306d9009d.zip |
simplify i18n strings mgmt, factor some code, show nav in a different way
Diffstat (limited to 'en')
-rw-r--r-- | en/1/migrate/index.php | 13 | ||||
-rw-r--r-- | en/index.php | 12 |
2 files changed, 8 insertions, 17 deletions
diff --git a/en/1/migrate/index.php b/en/1/migrate/index.php index 030ffaa10..e446ed2c9 100644 --- a/en/1/migrate/index.php +++ b/en/1/migrate/index.php @@ -1,15 +1,10 @@ <?php -$locale = explode('/', $_SERVER['REQUEST_URI']); -$locale = $locale[1]; - +define('HLANG', true); +require '../../../langs.php'; require 'locales.php'; -$locale = array_key_exists($locale, $_t) ? $locale : 'en'; - -$_t = ($locale == 'en') - ? $_t['en'] - : array_merge($_t['en'], $_t[$locale]); +$_t = i18n::get_strings($_t, $locale, $i18n_fallback_rules); ?> <!DOCTYPE html> @@ -24,7 +19,7 @@ $_t = ($locale == 'en') <?php include '../../../analytics.php'; ?> </head> <body class="release"> - <?php include '../../../langs.php'; ?> + <?php echo $hsnav; ?> <div id="doc" class="yui-t7"> <div id="hd" role="banner"><h1><a id="logo" href="/"><span>Mageia</span></a> <span class="lsep">|</span> <span class="subh"><?php echo $_t['page_h1']; ?></span></h1></div> diff --git a/en/index.php b/en/index.php index b1b848196..851676247 100644 --- a/en/index.php +++ b/en/index.php @@ -1,14 +1,10 @@ <?php -$locale = explode('/', $_SERVER['REQUEST_URI']); -$locale = $locale[1]; - +define('HLANG', true); +require '../langs.php'; include 'index_locales.php'; -if (!array_key_exists($locale, $_t)) - $locale = 'en'; - -$_t = array_merge($_t['en'], $_t[$locale]); +$_t = i18n::get_strings($_t, $locale, $i18n_fallback_rules); ?> <!DOCTYPE html> @@ -24,7 +20,7 @@ $_t = array_merge($_t['en'], $_t[$locale]); <?php include '../analytics.php'; ?> </head> <body class="release"> - <?php include '../langs.php'; ?> + <?php echo $hsnav; ?> <div id="doc" class="yui-t7"> <div id="hd" role="banner"><h1><a id="logo" href="/<?php echo $locale ?>/"><span>Mageia</span></a> <span class="lsep">|</span> <span class="subh"><?php echo $_t['page_h1']; ?></span></h1></div> |