Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bl_i18n_utils/utils.py
| Show First 20 Lines • Show All 1,129 Lines • ▼ Show 20 Lines | class I18nMessages: | ||||
| def write_messages_to_mo(self, fname): | def write_messages_to_mo(self, fname): | ||||
| """ | """ | ||||
| Write messages in fname mo file. | Write messages in fname mo file. | ||||
| """ | """ | ||||
| # XXX Temp solution, until I can make own mo generator working... | # XXX Temp solution, until I can make own mo generator working... | ||||
| import subprocess | import subprocess | ||||
| with tempfile.NamedTemporaryFile(mode='w+', encoding="utf-8") as tmp_po_f: | with tempfile.NamedTemporaryFile(mode='w+', encoding="utf-8") as tmp_po_f: | ||||
| os.makedirs(os.path.dirname(fname), exist_ok=True) | |||||
| self.write_messages_to_po(tmp_po_f) | self.write_messages_to_po(tmp_po_f) | ||||
| cmd = ( | cmd = ( | ||||
| self.settings.GETTEXT_MSGFMT_EXECUTABLE, | self.settings.GETTEXT_MSGFMT_EXECUTABLE, | ||||
| "--statistics", # show stats | "--statistics", # show stats | ||||
| tmp_po_f.name, | tmp_po_f.name, | ||||
| "-o", | "-o", | ||||
| fname, | fname, | ||||
| ) | ) | ||||
| ▲ Show 20 Lines • Show All 480 Lines • Show Last 20 Lines | |||||