-
-
Notifications
You must be signed in to change notification settings - Fork 74
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plural rule with injected argument not working as expected for Polish #672
Comments
HI Martin, thanks for the notice. Would you like to create a PR and add a few test cases for this? Thanks! |
I was checking the CLDR specification while working on a good solution and noticed that the category Edit: |
Hi @mledl, thanks for checking the spec. Maybe the easiest fix is to chane I wonder if this breaks some existing tests. Please consider this too when you create the PR. |
@mledl have you had the chance to try the suggested change in your project already? |
We are using the patch I started this issue with and it works since beginning of May without bug report and we went live with it last week. |
Thanks! |
I have been checking and verifying your proposed solution and noticed that replacing
What do you think? |
Right, then I think solution 2 would be the best. |
Was fixed in |
Hi Ivan! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
typesafe-i18n@5.24.3
for the project I'm working on.We were experiencing issues with certain languages like Polish (pl) and Arabic (ar) when using the plural feature. When checking the source code of your library I noticed that you are using
Intl.PluralRules
for mapping the correct form.We are using the plural (inject passed argument) rule:
{{singular|?? plural}}
and noticed that for the majority of languagespluralRules.select(value)
returnsother
for some value that will trigger plural for the given locale. Somehow, Polish never returnsother
, butmany
in all those cases whicht leads to the given plural rule not working since the switch statement in yourgetPlural()
method won't return the correct value.We managed to patch it as shown below for the Svelte adapter. Maybe there is a better and more general solution. Do you know about this problem already? I couldn't find any related issue.
Another option would be to change the plural rules on our end to the most generic one, which we would not really fancy to do.
Cheers, Martin
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: