-
Notifications
You must be signed in to change notification settings - Fork 57
Support custom function names #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Haha, this is what I feared when we hard-coded the I'll try to get to this soon. |
//cc @vrouet |
Thanks a lot! :) Well, in fact some libraries even use another position of arguments. Some going even further and providing chaining (like Jed). But I guess ability to remap arguments, or define somehow completely custom function would be too hard task. grunt-xgettext tried to implement it, but, unfortunately, they didn't advance much further than just discussion. |
I think the promise of jsxgettext is to support GNU gettext interface as closely as possible. Anything non-standard should not make it into the core package. I even hate the custom template parsers but that needs a larger refactor. |
yeah, I completely agree |
Maybe we can support it with regex? Users which would need only basic functionality could map each function to custom name just with object and strings inside, but if someone will need something custom — regex to the rescue with named regex groups. For sure we won't provide ready regex for non-trivial systems, like Jed, out of box. For simpler cases we can also map arguments based on user's input. Here are some thought about it: https://github.com/arendjr/grunt-xgettext/issues/8 |
For the informations: native |
Some projects uses another gettext function names, like,
_t()
for singular forms and_pt()
for plurals, etc.Is there any chances to see ability pass to jsxgettext object which will map custom function names to
gettext()
,ngettext()
and so on?grunt-xgettext partially implemented that feature, maybe something can be learned from it. Besides, there were issue about even further expending of that feature: https://github.com/arendjr/grunt-xgettext/issues/8
The text was updated successfully, but these errors were encountered: