Giter VIP home page Giter VIP logo

Comments (4)

willkg avatar willkg commented on June 15, 2024

@robhudson Want to look into this? The relevant pieces are here:

https://github.com/willkg/puente/blob/master/puente/management/commands/extract.py#L54

and the add_context/split_context functions are here in Tower:

https://github.com/clouserw/tower/blob/master/tower/__init__.py#L59

There's some docs on msgctxt in the gnu manual:

https://www.gnu.org/software/gettext/manual/html_node/Contexts.html

What we want to know is if we're using pgettext from Django, whether those strings get extracted into the .pot file with context. If not, then we have to figure out why. It's possible that pgettext and friends aren't in the KEYWORDS list or something like that.

from puente.

willkg avatar willkg commented on June 15, 2024

There's a bug in how we do KEYWORDS where we're not getting the magic incantations from Babel on how the keywords get parsed. Totally my fault.

Anyhow, fixing that allows pgettext to work fine in Python files.

Jinja2 trans blocks don't support context currently, so we don't have to worry about them. I don't know about Jinja2 gettext tags, though. The docs don't talk about context at all. I think we'd have to look at the code.

from puente.

willkg avatar willkg commented on June 15, 2024

Pretty sure I fixed what's fixable in d87ee58.

The only outstanding thing is how you do context stuff with Jinja2 gettext. Is it possible? Do we need to fix it in Puente and and submit a fix upstream?

from puente.

willkg avatar willkg commented on June 15, 2024

I'm going to close this out and create a new issue for supporting context in Jinja2 templates.

from puente.

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.