Mercurial > xmpp-account-manager
comparison build_website.py @ 56:010b905a74d4
Update translation strings
- prepend i18n loading for all "templates"
- add some strings
- commit the po files to the repo
author | mathieui |
---|---|
date | Sun, 24 May 2020 11:27:10 +0200 |
parents | 78f3f79c911b |
children | d5cfc04b9718 |
comparison
equal
deleted
inserted
replaced
55:6a7a99f5a0ca | 56:010b905a74d4 |
---|---|
70 'mam.js', 'nickname.js', 'pep.js', 'roster.js', 'strophe.js', 'strophe.mam.js', | 70 'mam.js', 'nickname.js', 'pep.js', 'roster.js', 'strophe.js', 'strophe.mam.js', |
71 'strophe.rsm.js', 'util.js', 'vcard.js' | 71 'strophe.rsm.js', 'util.js', 'vcard.js' |
72 ] | 72 ] |
73 for file_to_localize in files: | 73 for file_to_localize in files: |
74 with open(file_to_localize) as template_file: | 74 with open(file_to_localize) as template_file: |
75 template = Template(template_file.read()) | 75 template = Template('{% load i18n %}' + template_file.read()) |
76 rendered = template.render(Context({'AVAILABLE_LANGUAGES': | 76 rendered = template.render(Context({'AVAILABLE_LANGUAGES': |
77 AVAILABLE_LANGUAGES})) | 77 AVAILABLE_LANGUAGES})) |
78 filename = path.join(target_dir, file_to_localize) | 78 filename = path.join(target_dir, file_to_localize) |
79 with open(filename, 'w') as out: | 79 with open(filename, 'w') as out: |
80 out.write(rendered) | 80 out.write(rendered) |