Skip to content

Commit 23574a7

Browse files
babel: move config to pyproject.toml
Babel >= 2.16.0 (from 2024-08) supports this. python-babel/babel#1108
1 parent ad06a02 commit 23574a7

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

babel.cfg

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/devel/translate.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ string replacement.
138138
If you made changes to any gettext() string, please update the .pot file
139139
using::
140140

141-
pybabel extract -F babel.cfg -o src/moin/translations/MoinMoin.pot \
141+
pybabel extract -F pyproject.toml -o src/moin/translations/MoinMoin.pot \
142142
-k "_ gettext L_ lazy_gettext N_ ngettext" \
143143
--msgid-bugs-address "English <[email protected]>" \
144144
--copyright-holder "Moin Core Team, see http://moinmo.in/MoinCoreTeamGroup" \

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ classifiers = [
3636
"Topic :: Text Processing :: Markup",
3737
]
3838
dependencies = [
39-
"Babel >= 2.10.0", # internationalization support
39+
"Babel >= 2.16.0", # internationalization support
4040
"blinker >= 1.6.2", # event signalling (e.g. for change notification trigger)
4141
"docutils >= 0.18.1", # reST markup processing
4242
"Markdown >= 3.4.1", # Markdown markup processing
@@ -188,3 +188,17 @@ change_dir = ""
188188
commands = [
189189
["ruff", "check", "."]
190190
]
191+
192+
[tool.babel.extractors]
193+
# python works by default
194+
jinja2 = "jinja2.ext:babel_extract"
195+
196+
[[tool.babel.mappings]]
197+
method = "python"
198+
pattern = "**/*.py"
199+
encoding = "utf-8"
200+
201+
[[tool.babel.mappings]]
202+
method = "jinja2"
203+
pattern = ["**/templates/**/*.html", "**/templates/dictionary.js"]
204+
encoding = "utf-8"

0 commit comments

Comments
 (0)