More robust at handling hyphens (bug 2899)

This commit is contained in:
moodler
2005-04-13 04:18:24 +00:00
parent 22e5761eb3
commit 1ce8d3f0bd
+3 -3
View File
@@ -252,12 +252,12 @@
$cols=50;
if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) {
$rows = ceil($valuelen / $cols);
echo '<textarea name="string-'.$key.'" cols="'.$cols.'" rows="'.$rows.'">'.$value.'</textarea>'."\n";
echo '<textarea name="stringXXX'.$key.'" cols="'.$cols.'" rows="'.$rows.'">'.$value.'</textarea>'."\n";
} else {
if ($valuelen) {
$cols = $valuelen + 2;
}
echo '<input type="text" name="string-'.$key.'" value="'.$value.'" size="'.$cols.'" />';
echo '<input type="text" name="stringXXX'.$key.'" value="'.$value.'" size="'.$cols.'" />';
}
echo '</td>';
@@ -305,7 +305,7 @@ function lang_save_file($path, $file, $strings) {
ksort($strings);
foreach ($strings as $key => $value) {
list($id, $stringname) = explode("-",$key);
list($id, $stringname) = explode('XXX',$key);
if ($CFG->lang != "zh_hk" and $CFG->lang != "zh_tw") { // Some MB languages include backslash bytes
$value = str_replace("\\","",$value); // Delete all slashes
}