singleton
singleton copied to clipboard
[BUG] [Ruby Client]Failed to get number plural category by getString_p() and translate() interface.
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")