Initially the get_string() function, if any string wasn't found under
one lang (or its parent), was searched from "en" or "en_utf8" (depending of the status of the DB migration). But "en" isn't one full lang anymore under 1.6 but one "child" of "en_utf8" and it's completely empty so we must look for the string into his new parent too. This should solve problems with upgraded sites using non-english languages that were showing brackets everywhere. Now they will show the english strings until they manually install lang packages (1.5 packs) or automatically (1.6 packs).
This commit is contained in:
@@ -4787,6 +4787,31 @@ function get_string($identifier, $module='', $a=NULL) {
|
||||
}
|
||||
}
|
||||
|
||||
/// And, because under 1.6 en is defined as en_utf8 child, me must try
|
||||
/// if it hasn't been queried before.
|
||||
if ($defaultlang == 'en') {
|
||||
$defaultlang = 'en_utf8';
|
||||
foreach ($locations as $location) {
|
||||
$locallangfile = $location.$defaultlang.'_local/'.$module.'.php'; //first, see if there's a local file
|
||||
if (file_exists($locallangfile)) {
|
||||
if ($result = get_string_from_file($identifier, $locallangfile, "\$resultstring")) {
|
||||
eval($result);
|
||||
return $resultstring;
|
||||
}
|
||||
}
|
||||
|
||||
//if local_en not found, or string not found in local_en
|
||||
$langfile = $location.$defaultlang.'/'.$module.'.php';
|
||||
|
||||
if (file_exists($langfile)) {
|
||||
if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) {
|
||||
eval($result);
|
||||
return $resultstring;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '[['.$identifier.']]'; // Last resort
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user