aboutsummaryrefslogtreecommitdiffstats
path: root/langs.php
diff options
context:
space:
mode:
Diffstat (limited to 'langs.php')
-rw-r--r--langs.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/langs.php b/langs.php
index c67331eaf..9638518e3 100644
--- a/langs.php
+++ b/langs.php
@@ -47,6 +47,21 @@ foreach ($langs as $k => $v)
$v);
}
+// prevent 404 error on /{$locale}/ with missing translation
+function locale_path($locale,$path)
+{
+ $filename = "/".$locale."/".$path."/";
+ if (file_exists($filename)
+ {
+ $url = $filename;
+ }
+ else
+ {
+ $url = "/en/".$path;
+ }
+ return $url;
+}
+
// global nav
$nav_list = array(
"/{$locale}/" => 'Mageia',