' . PHP_EOL;
// $table .= ' |
';
$table .= "\t
" . PHP_EOL;
foreach ($documentation[$type][$version] 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') {
$lng_name = $langs['pt-br'];
} else {
$lng_name = $langs[$lng];
}
if ($link_locale == $lng) {
$your_language_present = TRUE;
if (is_null($epub_link) or is_null($pdf_link) or $hide_epub_pdf) {
$your_language = sprintf(_r('%s available in %s') . '
%s',
'' . $documentation_name . '', $lng_name, sprintf($link, $lng));
} else {
$your_language = sprintf(_r('%s available in %s') . '
%s ('.
_r('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) or $hide_epub_pdf) {
$others[] = sprintf('%s
%s', $lng_name, sprintf($link, $lng));
} else {
if(!$note_printed) {
$note = _r('also as') . ' ';
$note_printed = TRUE;
} else {
$note = '';
}
$others[] = sprintf('%s
%s (%s%s, %s)',
$lng_name, sprintf($link, $lng), $note, sprintf($epub_link, $lng), sprintf($pdf_link, $lng), sprintf($link, $lng));
}
}
}
if ($your_language_present) {
$text_your_language = '' . _r('Documentation in your language:') . '
';
if ($other_languages_present) {
$text_others = '' . _r('Other languages:') . '';
}
$table .= sprintf("\t\t%s |
" . PHP_EOL .
"\t\t |
" . PHP_EOL .
"\t\t%s |
" . PHP_EOL,
$your_language, $text_others);
} else {
foreach($documentation[$type] as $single_version => $all_languages) {
if($single_version < $version && in_array($link_locale, $all_languages)) {
$language_present_before = "\t\t" .
sprintf(_r('Translation was present in %s before. Maybe you can check documentation for %s in Mageia %s.'),
$langs[$locale], $documentation_name, $single_version) . " |
" . PHP_EOL;
break;
} else {
$language_present_before = '';
}
}
$text_your_language = _r('Please help us translate it in your language.') . '
';
$table .= sprintf("\t\t%s |
" . PHP_EOL .
"\t\t%s |
" . PHP_EOL . '%s' .
"\t\t |
" . PHP_EOL,
'' . $documentation_name . '', $text_your_language, $language_present_before);
}
foreach ($others as $other_languages) {
$table .= sprintf("\t\t%s |
" . PHP_EOL, $other_languages);
}
$table .= "\t" . PHP_EOL;
$table .= "" . PHP_EOL;
echo $table;
}