summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/translation.inc.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/translation.inc.php b/modules/translation.inc.php
index fc04fc52..d42066f3 100644
--- a/modules/translation.inc.php
+++ b/modules/translation.inc.php
@@ -384,10 +384,16 @@ class Page_Translation extends Page
Message::addWarning('i18n-empty-tag');
continue;
}
+ $value = trim($value);
if ($tag !== 'newtag') {
- $json[$lang][$tag] = $value;
+ if (empty($value)) {
+ unset($json[$lang][$tag]);
+ } else {
+ $json[$lang][$tag] = $value;
+ }
} else {
- $json[$lang][$_REQUEST['newtag']] = $value;
+ if (!empty($value)) // TODO: Error message if new tag's name collides with existing
+ $json[$lang][$_REQUEST['newtag']] = $value;
}
}