question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Translation bug for translate("...", {smart_count: 5})

See original GitHub issue

Not correctly using the smart-count parameter of the poliglot library. If I understand correctly, then it is used to determine the singular or plural (bulk_actions: “1 selected ||||% {smart_count} selected”). If you use it to display the counter, then unexpected values arise related to localization.

In particular, for the Russian language: translation("ra.action.bulk_actions", {smart_count: 5}) ==> "1 выбрано"

What happened instead:

Steps to reproduce:

  1. Open codesandbox
  2. Select >4 rows

propose a solution below.

I think such changes should be made for all translations where the text is used %{smart_count}

Environment

  • React-admin version: 3.2.2
  • Last version that did not exhibit the issue (if applicable):
  • React version:
  • Browser:
  • Stack trace (in case of a JS error):

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wmwartcommented, Feb 27, 2020

@fzaninotto, confirmation from Poliglot.js this is not a mistake Poliglot.js, this is a feature for russianPluralGroups().

To fix you issue, I suggest to add same 3rd option: “выбран только 1 |||| %{smart_count} выбрано |||| %{smart_count} выбрано”

need to fix ra-language-russian)

0reactions
fzaninottocommented, Mar 10, 2020

Thanks for taking the time to investigate this issue. I’m glad it’s not a react-admin bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

About best way to report a Translate issue found with Edge
Hello all, just today, while using Edge Enterprise v96.0.1054.34 (Official Build x64), I found a web site where Edge internal Translator ...
Read more >
Heat Translator - Launchpad Bugs
The heat-translator tool is aimed to translate non-heat templates to OpenStack Heat Orchestration Template (HOT). Initially the tool is aimed to translate ......
Read more >
Strange bug with google translate - Typeform Community
Hi Evrybody, I notice a very weird bug on one of my forms. The language in which the form is created is French....
Read more >
Translation Bug with Elementor Pro | WordPress.org
Hello,. I have translated fields from Elementor Pro with loco Translate but the changes are not taken into account (“read more >>”) It's...
Read more >
Broken pop-down menus when translating page from English ...
(I get "This page has been translated from [English] to [English]".) ... on Thu, Nov 1, 2012, 5:37 AM PDT Project Member ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found