[BUG] [Ruby Client]Failed to get number plural category by getString_p() and translate() interface.
@Xiaochao8 is already working on this.
Since May 10, 2022.
- 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:
- Load config file.
Singleton.load_config(<config file>, <mode>) - 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\" } }>"
- 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")
- Check the behavior:

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.