Giter VIP home page Giter VIP logo

Comments (6)

danhper avatar danhper commented on August 17, 2024

This functionality is not supported by the current implementation.
I remember having the same issue with other i18n libraries and finally just passed translated strings as variables, for example:

add_translation("foo.with_variable", "%{i18n_variable} is a translation")
add_translation("foo.variable", "my variable")
print(t("foo.with_variable", i18n_variable=t("foo.variable")))

Would this fit your current use case?

from python-i18n.

altamiro avatar altamiro commented on August 17, 2024

I had already tested that way there and know it works without problem ..

from python-i18n.

danhper avatar danhper commented on August 17, 2024

The implementation of nested translations seems to add too much complexity,
but if you want to give it a try I am open for pull requests.

from python-i18n.

altamiro avatar altamiro commented on August 17, 2024

I'm new still developing python and it still do not have the knowledge to modify codes. More if you want to make this implementation so that I can test. You can count on me.

from python-i18n.

torotil avatar torotil commented on August 17, 2024

Is there any use case for this? The use-case given above is a perfect example of how translations shouldn’t work. It makes assumptions on the language’s grammar that don’t hold in general.

from python-i18n.

Pukimaa avatar Pukimaa commented on August 17, 2024

I think actually it would be a little bit more organized and don't require to split to files if it isn't that much

from python-i18n.

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.