aboutsummaryrefslogtreecommitdiffstats
path: root/en/doc
diff options
context:
space:
mode:
Diffstat (limited to 'en/doc')
-rw-r--r--en/doc/doc.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/en/doc/doc.php b/en/doc/doc.php
index 0aa9e5884..8010876c8 100644
--- a/en/doc/doc.php
+++ b/en/doc/doc.php
@@ -8,17 +8,24 @@ $documentation['control_center'][3] = array('en','et','fr');
$documentation['installer' ][2] = array('de','el','en','eo','fr','nl','pt_br','uk');
-function doc_list($documentation_name, $type, $version, $link, $epub_link = null, $pdf_link = null)
+function doc_present_in_locale($documentation_name, $version)
{
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];
+ $link_locale = locale_hyphen_underscore($locale); // create pt_br.po from pt-br and alike
+ if(in_array($link_locale, $documentation[$documentation_name][$version])) {
+ return $link_locale;
} else {
- $link_locale = $locale;
+ return 'en';
}
+}
+
+function doc_list($documentation_name, $type, $version, $link, $epub_link = null, $pdf_link = null)
+{
+ global $locale;
+ global $langs;
+ global $documentation;
+ $link_locale = locale_hyphen_underscore($locale); // create pt_br.po from pt-br and alike
$your_language = '';
$others = '';
$text_others = '';