]> git.mjollnir.org Git - moodle.git/commitdiff
Small fix to make this script more usable on Multi-Byte languages like zh_hk
authormoodler <moodler>
Sun, 19 Jan 2003 05:25:31 +0000 (05:25 +0000)
committermoodler <moodler>
Sun, 19 Jan 2003 05:25:31 +0000 (05:25 +0000)
admin/lang.php

index a068b19b3cf2b4648f91a7e2b6b1ed9b40db4513..ac63641c923cc573eabcfa0fee90bf6463adabb9 100644 (file)
@@ -95,7 +95,7 @@
                         $first = false;
                         $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) {
         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("\"", "\\\"", $value);         // Add slashes for "
         $value = str_replace("%","%%",$value);              // Escape % characters