8000 add documentation for babel configuration · woodcoder/flask-assets@d1e48fb · GitHub
[go: up one dir, main page]

Skip to content

Commit d1e48fb

Browse files
committed
add documentation for babel configuration
1 parent 006864b commit d1e48fb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/index.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,27 @@ configuration. The following two statements are equivalent:
144144
For a list of available settings, see the full
145145
:ref:`webassets documentation <webassets:environment-configuration>`.
146146

147+
Babel Configuration
148+
~~~~~~~~~~~~~~~~~~~
149+
150+
If you use `Babel`_ for internationalization, then you will need to
151+
add the extension to your babel configuration file
152+
as ``webassets.ext.jinja2.AssetsExtension``
153+
154+
Otherwise, babel will not extract strings from any templates that
155+
include an ``assets`` tag.
156+
157+
Here is an example ``babel.cfg``:
158+
159+
.. code-block:: python
160+
161+
[python: **.py]
162+
[jinja2: **.html]
163+
extensions=jinja2.ext.autoescape,jinja2.ext.with_,webassets.ext.jinja2.AssetsExtension
164+
165+
166+
.. _Babel: http://babel.edgewall.org/
167+
147168

148169
Management Command
149170
------------------

0 commit comments

Comments
 (0)
0