-
Notifications
You must be signed in to change notification settings - Fork 128
Support context-extraction from filters. #63
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
Is there any other parameter you'd want to pass as the first argument to the filter? My only concern is that filter parameters don't really scale to large permutations of arguments, and there's a lot of ways you can traditionally call gettext (context, plurals, etc.) |
You're right: filters don't scale well. I don't like them, but we need them for some cases (e.g. translated attributes). See #39: we'll need a second filter to do plurals. |
Can you pass object literals to filters? Something like |
Yup, that could work as well. I'd be cool with that (it means we only need one filter!). We'd need to change the filter implementation as well then. |
It's also not too late to remove the |
angular-translate uses object literal-strings: https://github.com/angular-translate/angular-translate/wiki/Dynamize-your-translations#parametrizing-the-translate-filter We probably have to remove support for strings because angular doesn't like object literals passed to filters. |
@gabegorelick I'm considering a release of angular-gettext without context support in filters. This gives us an opportunity to get the fixes out there and gives us more time to figure out how to best move forward with filters. Are you OK with that? |
Fine by me. On Tuesday, December 16, 2014, Ruben Vermeersch [email protected]
|
Moving to 2.1. |
As you can see I created a pull request for the first proposal ( So far there was some criticism about extensibility, so here are some options:
Or actually how about imitating the gettext API more closely and implement filters pgettext, ngettext etc.? After all this is one of the advantages of using a standardized system so that everyone who is familiar with gettext can use the library intuitively. @gabegorelick: Why do you say:
As far as I know (and I just tested it) that works great. What is the problem there? |
See rubenv/angular-gettext#103
Pull requests welcome
The text was updated successfully, but these errors were encountered: