Refactoring translation script

This commit is contained in:
Julia Radzhabova 2021-07-30 15:23:54 +03:00
parent dab0216a3b
commit 6962f3b42b

View file

@ -11,11 +11,13 @@ def strSplit(str):
indLast = str.rfind('"') indLast = str.rfind('"')
result.append(str[ind3+1:indLast]) result.append(str[ind3+1:indLast])
return result return result
def sortByAlphabet(inputStr): def sortByAlphabet(inputStr):
return inputStr.lower() return inputStr.lower()
app_names = ['documenteditor', 'presentationeditor', 'spreadsheeteditor'] app_names = ['documenteditor', 'presentationeditor', 'spreadsheeteditor']
#app_types = ['embed', 'main', 'mobile']
app_types = ['embed', 'main'] app_types = ['embed', 'main']
prefix_apps = '../apps/' prefix_apps = '../apps/'
prefix_src = 'src/' prefix_src = 'src/'
@ -104,10 +106,10 @@ for i in range(len(app_names)):
print(' ' + lang + '.json - ' + changed) print(' ' + lang + '.json - ' + changed)
if os.path.isdir(src_path): if os.path.isdir(src_path):
add_langs = os.listdir(src_path) add_langs = os.listdir(src_path)
for l in range(len(langs)): for m in range(len(langs)):
if add_langs.count(langs[l])>0: if add_langs.count(langs[m]) > 0:
add_langs.remove(langs[l]) add_langs.remove(langs[m])
for l in range(len(add_langs)): for m in range(len(add_langs)):
lang = add_langs[l] lang = add_langs[m]
shutil.copyfile(src_path + lang, dest_path + lang) shutil.copyfile(src_path + lang, dest_path + lang)
print(' ' + lang + ' - ' + 'added') print(' ' + lang + ' - ' + 'added')