Skip to content
Snippets Groups Projects
Commit e3e7619a authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Allow case-insensitive locale spec

parent 699408f2
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,10 @@ class Internationalization { ...@@ -29,8 +29,10 @@ class Internationalization {
if ($cfg && ($lang = $cfg->getSystemLanguage())) if ($cfg && ($lang = $cfg->getSystemLanguage()))
array_unshift($this->langs, $language); array_unshift($this->langs, $language);
if ($language) // Detect language filesystem path, case insensitively
array_unshift($this->langs, $language); if ($language && ($info = self::getLanguageInfo($language))) {
array_unshift($this->langs, $info['code']);
}
} }
function getTemplate($path) { function getTemplate($path) {
...@@ -192,7 +194,7 @@ class Internationalization { ...@@ -192,7 +194,7 @@ class Internationalization {
static function getLanguageInfo($lang) { static function getLanguageInfo($lang) {
$langs = self::availableLanguages(); $langs = self::availableLanguages();
return @$langs[$lang] ?: array(); return @$langs[strtolower($lang)] ?: array();
} }
static function availableLanguages($base=I18N_DIR) { static function availableLanguages($base=I18N_DIR) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment