Comments (7)
We definitely should, I just don't have enough resources right now though :(
from jsxgettext.
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.
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.
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.
So, gettext plurals doesn't work currently in jsxgettext?
from jsxgettext.
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.
that's nice, thanks!
from jsxgettext.
Related Issues (20)
- Support ES6 template tags HOT 3
- Document .parse() and .generate() HOT 3
- Include filename in throw HOT 3
- Bad Message ID block merge HOT 1
- JSX bare attributes throw exception HOT 1
- Support the spread operator HOT 3
- Is it alive? HOT 4
- async/await
- Add vuejs language support
- Bump npm version please
- Switch from jade to pug
- Need support for JSX Fragments HOT 1
- Nunjucks inline if statement HOT 5
- Comments aren't extracted for jinja HOT 1
- Support for msgmerge like functionality or otherwise enable smarter merging. HOT 14
- support for ES6 / JSX HOT 9
- Support custom function names HOT 7
- Domain and context function HOT 1
- Implemented gettext functions HOT 1
- Extraction from jade templates, mixins don't work HOT 5
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 jsxgettext.