Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-01-29 12:34:26 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-01-29 12:34:26 +0400
commit97a5cd92bc807a03c4983ec70b1b961491062b13 (patch)
tree72ad61f616103b0cf2746c6bb52614bd280573e7 /release/scripts/modules/bl_i18n_utils/utils.py
parent6d4a6b957c5fd23e3b1356c86e7f16ccd0708b12 (diff)
Some optimization (their is much more possible here, but it will have to wait for complete refactor I’m working on currently).
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/utils.py')
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index 1c2e62b4c4e..d04e8bead7a 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -236,8 +236,9 @@ class I18nMessages:
import difflib
similar_pool = {}
if use_similar > 0.0:
- for key in self.msgs:
- similar_pool.setdefault(key[1], set()).add(key)
+ for key, msg in self.msgs.items():
+ if msg.msgstr: # No need to waste time with void translations!
+ similar_pool.setdefault(key[1], set()).add(key)
msgs = self._new_messages()
for (key, msg) in ref.msgs.items():
@@ -259,10 +260,11 @@ class I18nMessages:
if skey:
msgs[key].msgstr = self.msgs[skey].msgstr
msgs[key].is_fuzzy = True
- # Add back all "old" and already commented messages as commented ones, if required.
+ # Add back all "old" and already commented messages as commented ones, if required
+ # (and translation was not void!).
if keep_old_commented:
for key, msg in self.msgs.items():
- if key not in msgs:
+ if key not in msgs and msg.msgstr:
msgs[key] = msg
msgs[key].is_commented = True
# And finalize the update!