-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Introduce plurality handling based on message format for ngx-translate schema #2967
Comments
Should Weblate consider the case where messageformat keys are used only for part of the string, for example with MessageFormat people seems to think that it is a good idea, at least with the myriad possible plural or gender input combinations required. This would mean a very different UI: instead of giving one input boxes for each plural form, Weblate will need to come up with something that lets the user deal with this complexity, preferably visually. For now we can, of course, just treat these as any other variable format string and check for them as such... |
First step should be syntax validation. That way we ensure that translators get correct feedback in case they mess up something. The similar feature will be needed for Fluent (see #1926), but using different syntax. The UI might come later, once we switch to some rich editor (what is needed for things like #1930 or #443). |
There is even existing Python parser for the syntax: https://github.com/rolepoint/pyseeyou |
The pyseeyou grammar has lagged quite a bit compared to the js messageformat PEG. Among other things, we are likely to bump into problems with escapes and general function formatters. There is also a new ordinal class to take care of (I think.) I was planning to update it. |
Thanks for insight, I just found this library when looking for something else and did not investigate it at all. For the reference the related issue is rolepoint/pyseeyou#11 |
See also #2856 |
Any news regarding #3286 ? |
ICU support is being developed in #2856, that could be baseline for implementing this. |
Situation
Having angular applications where ngx-translate is used as translation handler, the basic JSON output is used as translation resource. This itself does not support pluralization. Therefore, plug-ins are available to properly handle this based on ICU MessageFormat.
Request
In order to use ngx-translate with proper pluralization, the schema needs to follow MessageFormat according ICU. Reference:
Example
English source
Czech translation
Requires
Follow-up to #2855
The text was updated successfully, but these errors were encountered: