vmware / vmware/singleton

[BUG] [Ruby Client]Can't get correct plurals "zero" and "one" categories for locale "prg".

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

Nobody has claimed this yet.

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

Description

Describe the bug
commit: b88b2e822377b4c8828d45998e5cfbf06a80c045
Can't get correct plurals "zero" and "one" categories for locale "prg".

To Reproduce
Steps to reproduce the behavior:
Locale "prg" plurals rule in cldr:

<pluralRules locales="lv prg">
            <pluralRule count="zero">n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 @integer 0, 10~20, 30, 40, 50, 60, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>
            <pluralRule count="one">n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, … @decimal 0.1, 1.0, 1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 10.1, 100.1, 1000.1, …</pluralRule>
            <pluralRule count="other"> @integer 2~9, 22~29, 102, 1002, … @decimal 0.2~0.9, 1.2~1.9, 10.2, 100.2, 1000.2, …</pluralRule>
        </pluralRules>

String in messages_prg.json file:

{
   "component" : "JAVA",
   "messages" : {
     "helloworld" : "prg_Hello world",
     "pluralsstr1" : "prg_there %<{ \"cat_count\": { \"zero\": \"is no cat\", \"one\": \"is one cat\", \"other\": \"are %{cat_count} cats\" } }> in the room"
   },
   "locale" : "prg"
 }

Method in .rb file:

@prg_Result_zero_int = SgtnClient::Translation.getString("JAVA", "pluralsstr1", "prg").to_plural_s("prg", { :cat_count => 0 })
@prg_Result_zero_decimal = SgtnClient::Translation.getString("JAVA", "pluralsstr1", "prg").to_plural_s("prg", { :cat_count => 15.0 })
@prg_Result_one_int = SgtnClient::Translation.getString("JAVA", "pluralsstr1", "prg").to_plural_s("prg", { :cat_count => 21 })
@prg_Result_one_decimal = SgtnClient::Translation.getString("JAVA", "pluralsstr1", "prg").to_plural_s("prg", { :cat_count => 1.1 })

Actual Result
The numbers is using other category.
@prg_Result_zero_int: prg_there are 0 cats in the room
@prg_Result_zero_decimal: prg_there are 15.0 cats in the room
@prg_Result_one_int: prg_there are 21 cats in the room
@prg_Result_one_decimal: prg_there are 1.1 cats in the room

Expected Result
The numbers(0/15.0) should use zero category.
@prg_Result_zero_int: prg_there is no cat in the room
@prg_Result_zero_decimal: prg_there is no cat in the room

The numbers(21/1.1) should use one category.
@prg_Result_one_int: prg_there is one cat in the room
@prg_Result_one_decimal: prg_there is one cat in the room

Additional context
Same issue happens for locale "lv".

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.