Small fix to make this script more usable on Multi-Byte languages like zh_hk

This commit is contained in:
moodler 2003-01-19 05:25:31 +00:00
parent b5fdd4c60a
commit e01b5c0e77

View file

@ -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