You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm very new to this package, so sorry if I'm misunderstanding something!
But it seems like the GetND and GetNDC methods in locale.go only return the plural default, not the singular when N=1.
I had quick look through the issues, and it looks like the same problem in the po.go file was fixed in #8, but the corresponding methods in locale.go weren't fixed at the same time.
The text was updated successfully, but these errors were encountered:
@alexedwards I've been looking into this issue, and while it's a bug, the solution is more complex than just N=1.
What's happening here is that the Locale object you're using doesn't have the Domain (Po object) you're requesting loaded, so it defaulted to the plural.
That said, the current implementation was using the n == 1 rule to identify singular cases, and that's kind of incorrect, because it would depend on the plurals definition from the .po file.
So I'm working on a solution in the Po object that will fallback to the corresponding default value based on the plural forms definitions in the .po file.
When it fallbacks to an non-existing translation string, but on an existing domain (.po file) it will use this new approach.
Otherwise, as if the domain isn't loaded and it doesn't knows how plural definitions are, it will fallback using the western n == 1 rule, just to make a convention here.
I'm very new to this package, so sorry if I'm misunderstanding something!
But it seems like the
GetND
andGetNDC
methods inlocale.go
only return the plural default, not the singular when N=1.I had quick look through the issues, and it looks like the same problem in the
po.go
file was fixed in #8, but the corresponding methods inlocale.go
weren't fixed at the same time.The text was updated successfully, but these errors were encountered: