Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update .properties
  • Loading branch information
plata authored Apr 19, 2018
commit 8b286a70d3f277497b0f326168e56cb3079a91ef
14 changes: 14 additions & 0 deletions i18n/update_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lanuage.po -> language.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]