diff --git a/tools/python/find_untranslated_strings.py b/tools/python/find_untranslated_strings.py index 74051f3580..84aed7dd8d 100755 --- a/tools/python/find_untranslated_strings.py +++ b/tools/python/find_untranslated_strings.py @@ -9,7 +9,7 @@ from sys import argv TransAndKey = namedtuple("TransAndKey", "translation, key") -TRANSLATION = re.compile(r"([a-z]{2}|zh-Han[st])\s*=\s*.*$", re.S | re.MULTILINE) +TRANSLATION = re.compile(r"([a-z]{2}|zh-Han[st]|en-GB)\s*=\s*.*$", re.S | re.MULTILINE) MANY_DOTS = re.compile(r"\.{4,}") SPACE_PUNCTUATION = re.compile(r"\s[.,?!:;]") PLACEHOLDERS = re.compile(r"(%\d*\$@|%[@dqus]|\^)") @@ -67,12 +67,13 @@ class StringsTxt: self.keys_in_order.append(line) continue if line.startswith("["): - if line in self.translations: - print("Duplicate key {}".format(line)) - continue + # if line in self.translations: + # print("Duplicate key {}".format(line)) + # continue self.translations[line] = {} current_key = line - self.keys_in_order.append(current_key) + if current_key not in self.keys_in_order: + self.keys_in_order.append(current_key) if TRANSLATION.match(line): lang, tran = self._parse_lang_and_translation(line)