Giter Site home page Giter Site logo

I18n example about pyramid_jinja2 HOT 5 CLOSED

pylons avatar pylons commented on June 12, 2024
I18n example

from pyramid_jinja2.

Comments (5)

rockyburt avatar rockyburt commented on June 12, 2024

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.

brutka avatar brutka commented on June 12, 2024

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.

rockyburt avatar rockyburt commented on June 12, 2024

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.

brutka avatar brutka commented on June 12, 2024

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.

rockyburt avatar rockyburt commented on June 12, 2024
  1. Create message catalogs
  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.