mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Small fix to make this script more usable on Multi-Byte languages like zh_hk
This commit is contained in:
parent
b5fdd4c60a
commit
e01b5c0e77
1 changed files with 4 additions and 2 deletions
|
@ -95,7 +95,7 @@
|
||||||
$first = false;
|
$first = false;
|
||||||
$somethingfound = true;
|
$somethingfound = true;
|
||||||
}
|
}
|
||||||
echo "$"."string[$key] = \"$value\";<BR>";
|
echo "$"."string['$key'] = \"$value\";<BR>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,9 @@ function lang_save_file($path, $file, $strings) {
|
||||||
|
|
||||||
foreach ($strings as $key => $value) {
|
foreach ($strings as $key => $value) {
|
||||||
list($id, $stringname) = explode("-",$key);
|
list($id, $stringname) = explode("-",$key);
|
||||||
$value = str_replace("\\","",$value); // Delete all slashes
|
if ($CFG->lang != "zh_hk") { // Some MB languages include backslash bytes
|
||||||
|
$value = str_replace("\\","",$value); // Delete all slashes
|
||||||
|
}
|
||||||
$value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a
|
$value = str_replace("$"."a", "\\$"."a", $value); // Add slashes for $a
|
||||||
$value = str_replace("\"", "\\\"", $value); // Add slashes for "
|
$value = str_replace("\"", "\\\"", $value); // Add slashes for "
|
||||||
$value = str_replace("%","%%",$value); // Escape % characters
|
$value = str_replace("%","%%",$value); // Escape % characters
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue