diff options
author | Filip Komar <filip@mageia.org> | 2013-12-29 22:06:03 +0000 |
---|---|---|
committer | Filip Komar <filip@mageia.org> | 2013-12-29 22:06:03 +0000 |
commit | e8ff11191ab18f67f97d72d600da790ef4406b3f (patch) | |
tree | 0fcb22d9a49576ee1faa8b33dda0ce8db2a28da5 /en/doc/index.php | |
parent | c2a4a92cbcb82fab386dedfb74502d9456f66bf0 (diff) | |
download | www-e8ff11191ab18f67f97d72d600da790ef4406b3f.tar www-e8ff11191ab18f67f97d72d600da790ef4406b3f.tar.gz www-e8ff11191ab18f67f97d72d600da790ef4406b3f.tar.bz2 www-e8ff11191ab18f67f97d72d600da790ef4406b3f.tar.xz www-e8ff11191ab18f67f97d72d600da790ef4406b3f.zip |
function expanded to focus on chosen language + arrays simplified
Diffstat (limited to 'en/doc/index.php')
-rw-r--r-- | en/doc/index.php | 75 |
1 files changed, 47 insertions, 28 deletions
diff --git a/en/doc/index.php b/en/doc/index.php index f8cefbcdf..a36032396 100644 --- a/en/doc/index.php +++ b/en/doc/index.php @@ -3,11 +3,31 @@ define('HLANG', true); require '../../langs.php'; _lang_load($locale, 'documentation'); -function doc_list($languages, $link) +function doc_list($languages, $link, $locale) { - foreach ($languages as $lng) { - echo sprintf($link, $lng[0], $lng[1]); + $your_language = ''; + $others = ''; + $text_others = ''; + $your_language_present = FALSE; + $other_languages_present = FALSE; + foreach ($languages as $lng => $lng_name) { + if ($locale == $lng) { + $your_language_present = TRUE; + $your_language = sprintf($link . '<br/><br/>', $lng, $lng_name); + } else { + $other_languages_present = TRUE; + $others .= sprintf($link . '<br/>', $lng, $lng_name); + } } + if ($your_language_present) { + $text_your_language = _t('Documentation in your language:'); + if ($other_languages_present) { + $text_others = _t('There are also:') . '<br/>'; + } + } else { + $text_your_language = _t('Please help <a href="../community/">us</a> translate it in your language.') . '<br/>'; + } + echo $text_your_language . $your_language . $text_others . $others; } ?><!DOCTYPE html> @@ -34,29 +54,29 @@ function doc_list($languages, $link) <h4><?php _e('Installer')?></h4> <p><?php $mga3_installer = array( - array('de', 'Deutsch'), - array('el', 'Ελληνικά'), - array('en', 'English'), - array('es', 'Español'), - array('et', 'Eesti'), - array('fr', 'Français'), - array('nl', 'Nederlands'), - array('pt_br', 'Português do Brasil'), - array('ru', 'Pусский'), - array('uk', 'Українська'), + 'de' => 'Deutsch', + 'el' => 'Ελληνικά', + 'en' => 'English', + 'es' => 'Español', + 'et' => 'Eesti', + 'fr' => 'Français', + 'nl' => 'Nederlands', + 'pt_br' => 'Português do Brasil', + 'ru' => 'Pусский', + 'uk' => 'Українська', ); - doc_list($mga3_installer, '<a href="//doc.mageia.org/installer/3/%s/content/index.html">%s</a><br/>'); + doc_list($mga3_installer, '<a href="//doc.mageia.org/installer/3/%s/content/index.html">%s</a>', $locale); ?></p> </div> <div style="float: right; margin: 2em;"> <h4><?php _e('Control Center')?></h4> <p><?php $mga3_control_center = array( - array('en', 'English'), - array('et', 'Eesti'), - array('fr', 'Français'), + 'en' => 'English', + 'et' => 'Eesti', + 'fr' => 'Français', ); - doc_list($mga3_control_center, '<a href="//doc.mageia.org/mcc/3/%s/content/index.html">%s</a><br/>'); + doc_list($mga3_control_center, '<a href="//doc.mageia.org/mcc/3/%s/content/index.html">%s</a>', $locale); ?></p> </div> <hr style="clear: both;"> @@ -65,17 +85,16 @@ function doc_list($languages, $link) <h4><?php _e('Installer')?></h4> <p><?php $mga2_installer = array( - array('de', 'Deutsch'), - array('el', 'Ελληνικά'), - array('en', 'English'), - array('eo', 'Esperanto'), - array('fr', 'Français'), - array('nl', 'Nederlands'), - array('pt_br', 'Português do Brasil'), - array('uk', 'Українська'), - + 'de' => 'Deutsch', + 'el' => 'Ελληνικά', + 'en' => 'English', + 'eo' => 'Esperanto', + 'fr' => 'Français', + 'nl' => 'Nederlands', + 'pt_br' => 'Português do Brasil', + 'uk' => 'Українська', ); - doc_list($mga2_installer, '<a href="//doc.mageia.org/installer/2/%s/content/index.html">%s</a><br/>'); + doc_list($mga2_installer, '<a href="//doc.mageia.org/installer/2/%s/content/index.html">%s</a>', $locale); ?></p> </div> </div> |