Search code examples
pythonconfigurationinternationalizationpython-babel

Where should the python babel mapping configuration file be placed or named for standalone script?


I am currently trying to use Babel to generate a set of static html pages in different languages using Jinja2 within a simple script (not as part of a web app)

I am at the point where I need to extract the messages for translation and I know that I am supposed to modify the Babel mapping configuration file to understand Jinja2 templates.Since I am using the commandline tool, I assume I need to create the mapping file myself.

However, I can't seem to find in the documentation what the mapping configuration file should be named and where it should be placed. All I know is that I need to place the following:

[jinja2: **/templates/**.html]
encoding = utf-8

into the mapping file according to the Jinja2 documentation. Has anyone done something similar or know what the mapping configuration file should be? Thanks!


Solution

  • You can specify the location of the configuration file with -c <filename>.