From 9b78c304fb9de812b42ee5f77be9cc1720fc0875 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 5 Nov 2020 23:37:05 +0300 Subject: [PATCH] Fix translation script --- translation/convert_translation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/translation/convert_translation.py b/translation/convert_translation.py index 00d8c45fa..43510f901 100644 --- a/translation/convert_translation.py +++ b/translation/convert_translation.py @@ -11,6 +11,9 @@ def strSplit(str): indLast = str.rfind('"') result.append(str[ind3+1:indLast]) return result +def sortByAlphabet(inputStr): + return inputStr.lower() + app_names = ['documenteditor', 'presentationeditor', 'spreadsheeteditor'] app_types = ['embed', 'main', 'mobile'] prefix_apps = '../apps/' @@ -40,6 +43,7 @@ for i in range(len(app_names)): arr = strSplit(lines[k]) if len(arr) > 0: str_apps.append(arr[0]) + str_apps.sort(key=sortByAlphabet) for l in range(len(langs)): lang = langs[l].split('.')[0] f = io.open(locale_path + lang+ '.json', mode='r', encoding='utf-8')