vmware / vmware/singleton

[BUG] [Ruby Client]Failed to get number plural category by getString_p() and translate() interface.

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

@Xiaochao8 is already working on this.

Since May 10, 2022.

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
Failed to get number plural category by getString_p() and translate() interface.
plural.no.placeholder.number: "%<{ "cat_count": { "1": "there is one cat in the room", "other": "there are %{cat_count} cats in the room" } }>"

To Reproduce
Steps to reproduce the behavior:

  1. Load config file.
    Singleton.load_config(<config file>, <mode>)
  2. The translation for en and fr locale:
en: plural.no.placeholder.number: "%<{ \"cat_count\": { \"**1**\": \"there is one cat in the room\", \"other\": \"there are %{cat_count} cats in the room\" } }>"
fr: "plural.no.placeholder.number": "%<{ \"cat_count\": { \"1\": \"il y a un chat dans la chambre\", \"other\": \"il y a %{cat_count} chats dans la pièce\" } }>"
  1. Invoke below interface:
expect(SgtnClient::Translation.getString_p("plural", "plural.no.placeholder.number", { :cat_count => 1 }, "FR")).to eq("il y a un chat dans la chambre")
expect(Singleton.t("plural.no.placeholder.number", "plural", "EN", cat_count: 1)).to eq("there is one cat in the room")
  1. Check the behavior:
    image

Expected behavior
expect(SgtnClient::Translation.getString_p("plural", "plural.no.placeholder.number", { :cat_count => 1 }, "FR")).to eq("il y a un chat dans la chambre")
expect(Singleton.t("plural.no.placeholder.number", "plural", "EN", cat_count: 1)).to eq("there is one cat 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.