Comments (5)
Are you adding "jinja2.ext.i18n" to the list of jinja2 extensions via the "jinja2.extensions" setting? (you can add that using development.ini if you are using paste)
from pyramid_jinja2.
Yes, I have added jinja2.ext.i18n in development.ini and if I pass
gettext to context explicitle - it works.
But I wanted to add it to context globally, and also add some methods
to Environment global - that is why I am messing with it in
__init__module.
If you can provide any example how to achieve this - that would be a
really great help.
thank you.
Regards,
Denys
On 4/6/11, rockyburt
[email protected]
wrote:
Are you adding "jinja2.ext.i18n" to the list of jinja2 extensions via the
"jinja2.extensions" setting? (you can add that using development.ini if you
are using paste)Reply to this email directly or view it on GitHub:
#19 (comment)
from pyramid_jinja2.
Well in any event, I went ahead and activated the i18n support in jinja2 (for pyramid_jinja2) by default. There's now a test (pyramid_jinja2/tests/test_ext.py) that shows using i18n... also there are docs now added. I just released this as 0.6.2 so please test with 0.6.2. If you still have trouble getting it working, please open a new issue.
from pyramid_jinja2.
Sorry, I didn't get what to do to get it working... :(
Could you please explain?
On Wed, Apr 6, 2011 at 10:55 PM, rockyburt
[email protected]
wrote:
Well in any event, I went ahead and activated the i18n support in jinja2 (for pyramid_jinja2) by default. There's now a test (pyramid_jinja2/tests/test_ext.py) that shows using i18n... also there are docs now added. I just released this as 0.6.2 so please test with 0.6.2. If you still have trouble getting it working, please open a new issue.
Reply to this email directly or view it on GitHub:
#19 (comment)
from pyramid_jinja2.
- Create message catalogs
- Add the base directory of the message catalogs to Pyramid's config via http://docs.pylonsproject.org/projects/pyramid/1.0/api/config.html#pyramid.config.Configurator.add_translation_dirs
Once you do steps #1 and #2 then {% trans %}some string{% endtrans %} will work in jinja2 templates.
from pyramid_jinja2.
Related Issues (20)
- Bug in GETTEXT when loading templates dynamically HOT 2
- After including pyramid_jinja2, config.get_jinja2_environment() is still None HOT 1
- Templates not found in sub-directories (add_jinja2_search_path ) HOT 6
- [Resolved]Log warnings while sphinx generate documentation HOT 3
- jinja2 exceptions propages to top - not caught by debug toolbar HOT 11
- release 2.6 HOT 3
- add test coverage for python 3.5 and pypy3, remove 3.2 HOT 2
- Impossible to set `jinja2.i18n.gettext` via configuration file HOT 7
- switch to py.test and pip HOT 3
- Typo in the default template in trans tag causes i18n to fail HOT 8
- convert scaffold to cookiecutter HOT 14
- add_jinja2_renderer `name` only works for default search path HOT 1
- globals cannot be set to strings HOT 1
- Can't list templates HOT 1
- ModuleNotFoundError: No module named 'pyramid_Jinja2' HOT 1
- Support for continue / break statements HOT 2
- add support for lstrip_blocks HOT 4
- Fix pypy version on Travis HOT 5
- What's the best way to add the current request object to Jinja's globals? HOT 3
- Requires Jinja2 3.0, but doesn't declare so HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyramid_jinja2.