Some checks are pending
CI / Test (Python 3.10 on macos-latest) (push) Waiting to run
CI / Test (Python 3.11 on macos-latest) (push) Waiting to run
CI / Test (Python 3.12 on macos-latest) (push) Waiting to run
CI / Test (Python 3.8 on macos-latest) (push) Waiting to run
CI / Test (Python 3.9 on macos-latest) (push) Waiting to run
CI / Test (Python 3.10 on ubuntu-latest) (push) Waiting to run
CI / Test (Python 3.11 on ubuntu-latest) (push) Waiting to run
CI / Test (Python 3.12 on ubuntu-latest) (push) Waiting to run
CI / Test (Python 3.8 on ubuntu-latest) (push) Waiting to run
CI / Test (Python 3.9 on ubuntu-latest) (push) Waiting to run
CI / Test (Python 3.10 on windows-latest) (push) Waiting to run
CI / Test (Python 3.11 on windows-latest) (push) Waiting to run
CI / Test (Python 3.12 on windows-latest) (push) Waiting to run
CI / Test (Python 3.8 on windows-latest) (push) Waiting to run
CI / Test (Python 3.9 on windows-latest) (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Release (push) Blocked by required conditions
Documentation / Build Documentation (push) Waiting to run
15 lines
377 B
Python
15 lines
377 B
Python
from babel.messages.pofile import read_po
|
|
from babel.messages.mofile import write_mo
|
|
from pathlib import Path
|
|
|
|
po_path = Path('i18n/locales/en_US/LC_MESSAGES/sikuwa.po')
|
|
mo_path = po_path.with_suffix('.mo')
|
|
|
|
with open(po_path, 'rb') as f:
|
|
catalog = read_po(f)
|
|
|
|
with open(mo_path, 'wb') as f:
|
|
write_mo(f, catalog)
|
|
|
|
print(f"Successfully compiled {po_path} to {mo_path}")
|