forked from Github-Mirrors/canaille
fix: babel is required at build by the project metadata
This commit is contained in:
parent
1352752db8
commit
c3a93c5f6f
4 changed files with 12 additions and 33 deletions
18
build.py
18
build.py
|
@ -1,17 +1,15 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def create_mo_files(setup_kwargs):
|
||||
print("Compile translations:")
|
||||
subprocess.run(
|
||||
[
|
||||
"pybabel",
|
||||
"compile",
|
||||
"--directory",
|
||||
os.path.dirname(__file__) + "/canaille/translations",
|
||||
]
|
||||
)
|
||||
from babel.messages.frontend import compile_catalog
|
||||
|
||||
cmd = compile_catalog()
|
||||
cmd.directory = os.path.dirname(__file__) + "/canaille/translations"
|
||||
cmd.quiet = True
|
||||
cmd.statistics = True
|
||||
cmd.finalize_options()
|
||||
cmd.run()
|
||||
return setup_kwargs
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ All the other steps are automatically done with Weblate.
|
|||
Extract the messages with:
|
||||
|
||||
```
|
||||
pybabel extract --mapping-file canaille/translations/babel.cfg --output-file canaille/translations/messages.pot canaille
|
||||
pybabel extract --copyright-holder="Yaal Coop" --output-file canaille/translations/messages.pot canaille
|
||||
```
|
||||
|
||||
Add a new language with:
|
||||
|
@ -17,11 +17,11 @@ pybabel init --input-file canaille/translations/messages.pot --output-dir canail
|
|||
Update the catalogs with:
|
||||
|
||||
```
|
||||
pybabel update --input-file canaille/translations/messages.pot --output-dir canaille/translations
|
||||
pybabel update --input-file canaille/translations/messages.pot --output-dir canaille/translations --ignore-obsolete --no-fuzzy-matching --update-header-comment
|
||||
```
|
||||
|
||||
Compile the catalogs with:
|
||||
|
||||
```
|
||||
pybabel compile --directory canaille/translations
|
||||
pybabel compile --directory canaille/translations --statistics
|
||||
```
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[build-system]
|
||||
requires = ["poetry>=1.0.0"]
|
||||
requires = ["poetry>=1.0.0", "babel"]
|
||||
build-backend = "poetry.masonry.api"
|
||||
|
||||
[tool]
|
||||
|
|
19
setup.cfg
19
setup.cfg
|
@ -1,19 +0,0 @@
|
|||
[extract_messages]
|
||||
copyright_holder = Yaal Coop Team
|
||||
input_paths = canaille
|
||||
output_file = canaille/translations/messages.pot
|
||||
|
||||
[init_catalog]
|
||||
input_file = canaille/translations/messages.pot
|
||||
output_dir = canaille/translations/
|
||||
|
||||
[update_catalog]
|
||||
input_file = canaille/translations/messages.pot
|
||||
output_dir = canaille/translations/
|
||||
update-header-comment = true
|
||||
no-fuzzy-matching = true
|
||||
ignore-obsolete = true
|
||||
|
||||
[compile_catalog]
|
||||
directory = canaille/translations/
|
||||
statistics = true
|
Loading…
Reference in a new issue