_local language packs take precedence with both forced language and non-forced language settings.

Fixes reopened MDL-8089.
This commit is contained in:
mudrd8mz 2007-02-10 21:54:19 +00:00
parent c327e15031
commit 2f40b60145

View File

@ -34,19 +34,21 @@ if (!empty($file)) {
// Get the list of parent languages.
if (empty($forcelang)) {
$langs = array(current_language(), get_string('parentlanguage'), 'en_utf8'); // Fallback
// _local language packs take precedence
$xlangs = array();
foreach ($langs as $lang) {
if (!empty($lang)) {
$xlangs[] = $lang . '_local';
$xlangs[] = $lang;
}
}
$langs = $xlangs;
unset($xlangs);
} else {
$langs = array($forcelang);
}
// _local language packs take precedence with both forced language and non-forced language settings
$xlangs = array();
foreach ($langs as $lang) {
if (!empty($lang)) {
$xlangs[] = $lang . '_local';
$xlangs[] = $lang;
}
}
$langs = $xlangs;
unset($xlangs);
// Define possible locations for help file similar to locations for language strings
// Note: Always retain module directory as before