singleton
singleton copied to clipboard
[BUG] [Ruby Client]Can't get plural "other" category for locale "pt-PT" when 0≤number<1 and 1<number<2.
Describe the bug commit: b88b2e822377b4c8828d45998e5cfbf06a80c045 Can't get plural "other" category for locale "pt-PT" when 0≤number<1 and 1<number<2.
To Reproduce Steps to reproduce the behavior: pt-PT plural rule in cldr:
<pluralRules locales="it pt_PT">
<pluralRule count="one">i = 1 and v = 0 @integer 1</pluralRule>
<pluralRule count="many">e = 0 and i != 0 and i % 1000000 = 0 and v = 0 or e != 0..5 @integer 1000000, 1c6, 2c6, 3c6, 4c6, 5c6, 6c6, … @decimal 1.0000001c6, 1.1c6, 2.0000001c6, 2.1c6, 3.0000001c6, 3.1c6, …</pluralRule>
<pluralRule count="other"> @integer 0, 2~16, 100, 1000, 10000, 100000, 1c3, 2c3, 3c3, 4c3, 5c3, 6c3, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 1.0001c3, 1.1c3, 2.0001c3, 2.1c3, 3.0001c3, 3.1c3, …</pluralRule>
</pluralRules>
String in messages_pt-PT.json file:
{
"component" : "JAVA",
"messages" : {
"helloworld" : "ptPT_Hello world",
"pluralsstr1" : "%<{ \"cat_count\": { \"one\": \"ptPT_there is one cat\", \"other\": \"ptPT_there are %{cat_count} cats\" } }> in the room"
},
"locale" : "pt-PT"
}
Method in .rb file:
@ptpt_Result_0p0_other = SgtnClient::Translation.getString("JAVA", "pluralsstr1", "pt-PT").to_plural_s("pt-PT", { :cat_count => 0.0 })
@ptpt_Result_1p9_other = SgtnClient::Translation.getString("JAVA", "pluralsstr1", "pt-PT").to_plural_s("pt-PT", { :cat_count => 1.99990 })
Actual behavior These numbers use one category. @ptpt_Result_0p0_other: ptPT_there is one cat in the room @ptpt_Result_1p9_other: ptPT_there is one cat in the room
Expected behavior These numbers should use other category. @ptpt_Result_0p0_other: ptPT_there are 0.0 cats in the room @ptpt_Result_1p9_other: ptPT_there are 1.99990 cats in the room