mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Fixes notices produced by PHP when saving new strings into _local without corresponding master translation.
This commit is contained in:
parent
5adad31057
commit
a98fe27240
@ -711,8 +711,9 @@ function lang_save_file($path, $file, $strings, $local, $packstrings) {
|
||||
@list($id, $stringname) = explode('XXX',$key);
|
||||
$value = lang_fix_value_before_save($value);
|
||||
if ($id == "string" and $value != ""){
|
||||
if ((!$local) || (lang_fix_value_from_file($packstrings[$stringname]) <> lang_fix_value_from_file($value))) {
|
||||
if ((!$local) || (!isset($packstrings[$stringname])) || (lang_fix_value_from_file($packstrings[$stringname]) <> lang_fix_value_from_file($value))) {
|
||||
// Either we are saving the master language pack
|
||||
// or the string is not saved in packstring - fixes PHP notices about missing key
|
||||
// or we are saving local language pack and the strings differ.
|
||||
fwrite($f,"\$string['$stringname'] = '$value';\n");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user