Browse Source

mlstring: delete an translation

ArnAud 9 years ago
parent
commit
fbb6a39261
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      Lodel/utils/mlstring.py

+ 5
- 1
Lodel/utils/mlstring.py View File

@@ -15,7 +15,11 @@ class MlString(object):
15 15
         return self.translations[lang]
16 16
 
17 17
     def set(self, lang, text):
18
-        self.translations[lang] = text
18
+        if not text:
19
+            if lang in self.translations:
20
+                del(self.translations[lang])
21
+        else:
22
+            self.translations[lang] = text
19 23
 
20 24
     def __str__(self):
21 25
         if self.translations:

Loading…
Cancel
Save