vmware / vmware/singleton

[BUG] [Ruby Client]Can't get plural "other" category for locale "pt-PT" when 0≤number<1 and 1<number<2.

Open
#1,377 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

area/ruby-client kind/bug priority/medium
Dominant language
Java
Stars
72
Forks
69
Avg merge
23h 32m
Merged PRs (30d)
4

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.