From 24779c5b13e6c1830462169c36fec6d888cc2949 Mon Sep 17 00:00:00 2001 From: Filip Komar Date: Tue, 21 Jan 2014 02:15:17 +0000 Subject: doc entry page converted to table --- en/doc/doc.php | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'en/doc/doc.php') diff --git a/en/doc/doc.php b/en/doc/doc.php index 5b70c0612..25dc0a742 100644 --- a/en/doc/doc.php +++ b/en/doc/doc.php @@ -8,7 +8,7 @@ $mga3_control_center = array('en','et','fr'); $mga2_installer = array('de','el','en','eo','fr','nl','pt_br','uk'); -function doc_list($languages, $link, $epub_link = null, $pdf_link = null) +function doc_list($documentation_name, $languages, $link, $epub_link = null, $pdf_link = null) { global $locale; global $langs; @@ -17,6 +17,9 @@ function doc_list($languages, $link, $epub_link = null, $pdf_link = null) $text_others = ''; $your_language_present = FALSE; $other_languages_present = FALSE; + $table = PHP_EOL . '' . PHP_EOL; +// $table .= ''; + $table .= "\t" . PHP_EOL; foreach ($languages as $lng) { // hopefully temporary exception for pt-br as convention for lang-abbrev in /langs.inc.php is different as link in doc.mageia.org if ($lng == 'pt_br') { @@ -30,31 +33,45 @@ function doc_list($languages, $link, $epub_link = null, $pdf_link = null) if ($locale == $lng) { $your_language_present = TRUE; if (is_null($epub_link) or is_null($pdf_link)) { - $your_language = sprintf($lng_name . ' ~> ' . $link . '

', $lng, $lng_name) . PHP_EOL; + $your_language = sprintf(_t('%s available in %s') . '
%s', + '' . $documentation_name . '', $lng_name, sprintf($link, $lng)); } else { - $your_language = sprintf($lng_name . ' ~> ' . $link . - ' ( ' . _t('available in:') . - $epub_link . ', ' . $pdf_link . ')

', - $lng, $lng, $lng) . PHP_EOL; + $your_language = sprintf(_t('%s available in %s') . '
%s ('. + _t('also as') . '%s , %s)', + '' . $documentation_name . '', + $lng_name, sprintf($link, $lng), sprintf($epub_link, $lng), sprintf($pdf_link, $lng)); } } else { $other_languages_present = TRUE; if (is_null($epub_link) or is_null($pdf_link)) { - $others .= sprintf($lng_name . ' ~> ' . $link . '
', $lng, $lng_name) . PHP_EOL; + $others[] = sprintf('%s
%s', $lng_name, sprintf($link, $lng)); } else { - $others .= sprintf($lng_name . ' ~> ' . $link . - ' ( ' . $epub_link . - ', ' . $pdf_link . ')
', $lng, $lng, $lng) . PHP_EOL; + $others[] = sprintf('%s
%s (%s , %s)', + $lng_name, sprintf($link, $lng), sprintf($epub_link, $lng), sprintf($pdf_link, $lng), sprintf($link, $lng)); } } } if ($your_language_present) { $text_your_language = '' . _t('Documentation in your language:') . '
'; if ($other_languages_present) { - $text_others = '' . _t('There are also:') . '
'; + $text_others = '' . _t('Other languages:') . ''; } + $table .= sprintf("\t\t" . PHP_EOL . + "\t\t" . PHP_EOL . + "\t\t" . PHP_EOL, + $your_language, $text_others); } else { $text_your_language = _t('Please help us translate it in your language.') . '
'; + $table .= sprintf("\t\t" . PHP_EOL . + "\t\t" . PHP_EOL . + "\t\t" . PHP_EOL, + '' . $documentation_name . '', $text_your_language); } - echo $text_your_language . $your_language . $text_others . $others; + foreach ($others as $other_languages) { + $table .= sprintf("\t\t" . PHP_EOL, $other_languages); + } + $table .= "\t" . PHP_EOL; + $table .= "
%s
 
%s
%s
%s
 
%s
" . PHP_EOL; + + echo $table; } -- cgit v1.2.1