سؤال

I am using pybabel to translate wordings in my templates. Templates are handled by jinja2. I created a jinja2 Extension to automatically generate my breadcrumb. However, extracting the wordings with babel is now impossible:

pybabel extract -F /PROJECT/PATH/babel.conf /PROJECT/PATH

results in a:

TemplateSyntaxError: Encountered unknown tag 'breadcrumbs'. Jinja was looking for the following tags: 'endblock'. The innermost block that needs to be closed is 'block'.

(I debugged the babel egg).

I know the origin of the issue: My breadcrumb extension is not loaded in babel when extracting the wordings from command line. Does anybody know how to load it or how to declare tags to blacklist in the babel conf file?

Many thanks!!

هل كانت مفيدة؟

المحلول

Fill "extensions" option in [jinja2:] section in babel.conf.

In my project I use this babel.conf

[jinja2: **.tex]
encoding = utf-8
block_start_string = <!!
block_end_string = !!>
variable_start_string = <!
variable_end_string = !>
comment_start_string = <!!!
comment_end_string = !!!>
extensions= jinja2.ext.i18n, jinja2.ext.do
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top