diff options
Diffstat (limited to 'BuildTools/CheckTranslations.py')
-rwxr-xr-x | BuildTools/CheckTranslations.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/BuildTools/CheckTranslations.py b/BuildTools/CheckTranslations.py index 5796bac..8dcf414 100755 --- a/BuildTools/CheckTranslations.py +++ b/BuildTools/CheckTranslations.py @@ -14,6 +14,7 @@ for filename in os.listdir("Swift/Translations") : m = re.match("swift_(.*)\.ts", filename) if m : language = m.group(1) + finished = True f = open("Swift/Translations/" + filename, "r") document = xml.dom.minidom.parse(f) f.close() @@ -23,7 +24,11 @@ for filename in os.listdir("Swift/Translations") : sourceText = getText(source.childNodes) sourcePlaceholders = set(re.findall("%\d+%?", sourceText)) translation = message.getElementsByTagName("translation")[0] + if "type" in translation.attributes.keys() and translation.attributes["type"]. value == "unfinished" : + finished = False translationText = getText(translation.childNodes) translationPlaceholders = set(re.findall("%\d+%?", translationText)) if translationPlaceholders != sourcePlaceholders : print "[Error] " + filename + ": Placeholder mismatch in translation '" + sourceText + "'" + if not finished : + print "[Warning] " + filename + ": Unfinished" |