From 8b286a70d3f277497b0f326168e56cb3079a91ef Mon Sep 17 00:00:00 2001 From: plata Date: Thu, 19 Apr 2018 21:21:31 +0200 Subject: [PATCH 1/3] Update .properties --- i18n/update_translations.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/i18n/update_translations.py b/i18n/update_translations.py index 0b43e5d4d7..0fffe3bb9b 100755 --- a/i18n/update_translations.py +++ b/i18n/update_translations.py @@ -61,3 +61,17 @@ ps.communicate()[0] shutil.rmtree(out_dir) + +# update .properties for all available languages +print "\nupdate .properties for all available languages" +languages = [] +for root, dir_names, file_names in os.walk(cwd + '/i18n'): + # the .po's are named lanuage.po (e.g. de.po) + # therefore we can get the available languages by finding all .po's and removing the file extension + for file_name in fnmatch.filter(file_names, '*.po'): + languages.append(os.path.splitext(file_name)[0]) +for language in languages: + print " {}".format(language) + # update .properties based on .po + ps = subprocess.Popen('msgcat --properties-output i18n/{0}.po -o i18n/Messages_{0}.properties'.format(language), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + ps.communicate()[0] From e88cf3f4686ea27ed57e8764b306e8f4f9e00f08 Mon Sep 17 00:00:00 2001 From: plata Date: Thu, 19 Apr 2018 21:22:01 +0200 Subject: [PATCH 2/3] Update push_translations.sh --- i18n/push_translations.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/push_translations.sh b/i18n/push_translations.sh index caac80783d..35bb9fe54c 100755 --- a/i18n/push_translations.sh +++ b/i18n/push_translations.sh @@ -27,7 +27,7 @@ if [ $? == 0 ]; then exit 1 fi git checkout master - git add *.pot + git add *.pot *.properties git commit --message "Update translations" if ! git push https://$GH_TOKEN@github.com/PhoenicisOrg/scripts.git > /dev/null 2>&1; then echo "could not push translation updates" From 40e7a583f485c71ecc5ec9408288b4fda6ed2a3c Mon Sep 17 00:00:00 2001 From: plata Date: Fri, 20 Apr 2018 16:52:19 +0200 Subject: [PATCH 3/3] Fix typo --- i18n/update_translations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/update_translations.py b/i18n/update_translations.py index 0fffe3bb9b..e39eef342f 100755 --- a/i18n/update_translations.py +++ b/i18n/update_translations.py @@ -66,7 +66,7 @@ print "\nupdate .properties for all available languages" languages = [] for root, dir_names, file_names in os.walk(cwd + '/i18n'): - # the .po's are named lanuage.po (e.g. de.po) + # the .po's are named language.po (e.g. de.po) # therefore we can get the available languages by finding all .po's and removing the file extension for file_name in fnmatch.filter(file_names, '*.po'): languages.append(os.path.splitext(file_name)[0])