From e560c751132d5dc7c962ae0604ef1e17708c5b62 Mon Sep 17 00:00:00 2001 From: Filip Komar Date: Tue, 28 Jan 2014 18:55:20 +0000 Subject: small bugfix for pt-br and another for abandoned translations --- en/doc/doc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'en/doc') diff --git a/en/doc/doc.php b/en/doc/doc.php index abd991774..ca93060a3 100644 --- a/en/doc/doc.php +++ b/en/doc/doc.php @@ -13,6 +13,12 @@ function doc_list($documentation_name, $type, $version, $link, $epub_link = null global $locale; global $langs; global $documentation; + preg_match("/(..)(-)(..)/", $locale, $parsed_locale); + if(isset($parsed_locale[3])) { // create pt_br.po from pt-br and alike + $link_locale = $parsed_locale[1] . '_' . $parsed_locale[3]; + } else { + $link_locale = $locale; + } $your_language = ''; $others = ''; $text_others = ''; @@ -31,7 +37,7 @@ function doc_list($documentation_name, $type, $version, $link, $epub_link = null $lng_name = $langs[$lng]; } - if ($locale == $lng) { + if ($link_locale == $lng) { $your_language_present = TRUE; if (is_null($epub_link) or is_null($pdf_link)) { $your_language = sprintf(_t('%s available in %s') . '
%s', @@ -63,10 +69,11 @@ function doc_list($documentation_name, $type, $version, $link, $epub_link = null $your_language, $text_others); } else { foreach($documentation[$type] as $single_version => $all_languages) { - if($single_version < $version && in_array($locale, $all_languages)) { + if($single_version < $version && in_array($link_locale, $all_languages)) { $language_present_before = "\t\t" . sprintf("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 = ''; } -- cgit v1.2.1