aboutsummaryrefslogtreecommitdiffstats
path: root/en/doc
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-02-01 15:24:23 +0000
committerFilip Komar <filip@mageia.org>2014-02-01 15:24:23 +0000
commitbad35065a7db4589b08ed2f3b3fa109e552fb0d7 (patch)
tree63edf84308401f0e0e812dd2d574bf0e7f73d3e3 /en/doc
parent3ad03d2182d5cc4e5a3d4ea63a98ea138771d886 (diff)
downloadwww-bad35065a7db4589b08ed2f3b3fa109e552fb0d7.tar
www-bad35065a7db4589b08ed2f3b3fa109e552fb0d7.tar.gz
www-bad35065a7db4589b08ed2f3b3fa109e552fb0d7.tar.bz2
www-bad35065a7db4589b08ed2f3b3fa109e552fb0d7.tar.xz
www-bad35065a7db4589b08ed2f3b3fa109e552fb0d7.zip
create function locale_hyphen_underscore and make use of it
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 = '';