Giter VIP home page Giter VIP logo

Comments (7)

BYK avatar BYK commented on August 17, 2024

We definitely should, I just don't have enough resources right now though :(

from jsxgettext.

justinvdm avatar justinvdm commented on August 17, 2024

Ah, cool. We could try help out on this if you like? We just need to know how you would like things to look from the user's perspective.

For example, there is currently a keyword option to look for a different symbol than 'gettext', but that'd need to change once we add ngettext and friends. We could either add a keyword option for each (which sounds a little weird I think), or instead change keyword to look up the object that the gettext methods were called on. So, for example, if keyword was _, we would look for _.gettext, ..., _.ngettext.

Let me know me what you think :)

from jsxgettext.

BYK avatar BYK commented on August 17, 2024

I'd say we should look for 'n' + keyword and 'd' + keyword when we add those. Also it looks like they'll need somewhat different parsing logic than the current gettext implementation so I think they should be in their respective functions.

from jsxgettext.

TeaSeaLancs avatar TeaSeaLancs commented on August 17, 2024

Hi, i'm not sure how much further you've got with adding this functionality, however i've implemented rudimentary support for ngettext this afternoon on my local project.

The solution I went with with regards to the keywords debate above was to follow the keyword spec syntax that xgettext itself uses. For example, this would specify a standard translation keyword of "tr" and a plural translation keyword of "trn":

['tr','trn:1,2']

Obviously this hasn't proceeded any further than the rudimentary support that I need but hopefully i've done it in such a way that makes the logic easy to extend for adding context support, etc.

I've pushed the changes into my fork at https://github.com/TeaSeaLancs/jsxgettext if you care to take a look :)

from jsxgettext.

ArmorDarks avatar ArmorDarks commented on August 17, 2024

So, gettext plurals doesn't work currently in jsxgettext?

from jsxgettext.

BYK avatar BYK commented on August 17, 2024

Yup, unfortunately :(

On Fri, Feb 20, 2015, 11:39 Serj Lavrin [email protected] wrote:

So, gettext plurals doesn't work currently in jsxgettext?


Reply to this email directly or view it on GitHub
#51 (comment).

from jsxgettext.

ArmorDarks avatar ArmorDarks commented on August 17, 2024

that's nice, thanks!

from jsxgettext.

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.