Skip to content

Commit

Permalink
Add setup.cfg for convenience commands for translations
Browse files Browse the repository at this point in the history
Add Babel options catered to the locale/ directory of the pygeoapi repo
so that the following convenient commands can be used without additional
command-line options for managing translation files:

	python3 setup.py compile_catalog
	python3 setup.py extract_messages
	python3 setup.py init_catalog
	python3 setup.py update_catalog

See https://babel.pocoo.org/en/latest/setup.html
  • Loading branch information
anthonyfok committed Mar 2, 2022
1 parent 676ffc7 commit ad8ec02
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion babel-mapping.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[python: **.py]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.i18n,jinja2.ext.autoescape,jinja2.ext.with_
extensions=jinja2.ext.i18n,jinja2.ext.autoescape,jinja2.ext.with_
14 changes: 14 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[compile_catalog]
directory = locale

[extract_messages]
mapping_file = babel-mapping.ini
output_file = locale/messages.pot

[init_catalog]
input_file = locale/messages.pot
output_dir = locale

[update_catalog]
input_file = locale/messages.pot
output_dir = locale

0 comments on commit ad8ec02

Please sign in to comment.