Tools: Updated crowdin script after PR #5021

This commit is contained in:
Yorik van Havre
2021-09-13 15:40:36 +02:00
parent 811004b6c8
commit 455412ccc7

View File

@@ -296,19 +296,17 @@ def updateTranslatorCpp(lncode):
f.close()
# checking for existing entry
for l in cppcode:
lastentry = 0
for i,l in enumerate(cppcode):
if l.startswith(" d->mapLanguageTopLevelDomain[QT_TR_NOOP("):
lastentry = i
if "\""+lncode+"\"" in l:
print(lnname+" ("+lncode+") already exists in Translator.cpp")
return
# find the position to insert
pos = None
for i in range(len(cppcode)):
if cppcode[i].startswith( " d->activatedLanguage = "):
pos = i-1
break
if pos is None:
pos = lastentry + 1
if pos == 1:
print("ERROR: couldn't update Translator.cpp")
sys.exit()