Incorrect use of _n()
-
When working with the translation of your plugin I noted one incorrect use of the function _n().
In
https://plugins.trac.www.ads-software.com/browser/loco-translate/trunk/src/js/Strings.php#L33_n("1 string marked Fuzzy","%s strings marked Fuzzy",0,'loco-translate');
_n() should be used only when the phrase contains a specific number, for instance:
You have X login attempts remaining.
X e-mails have been deleted.Russian, as an example, the tranlator needs to write three (3) diffeerent translation whenever _n() is used.
The first one (singular) is used for 1, 21, 31, 41… 101, etc.
The second one (dual) is used for 2, 3, 4, 22, 23, 24… 102, 103, 104, etc.
The third one (plural) is used for everything else.In other words, if you would happen to have 21 invalid form names, then a website that is configured to use Russian would present that phrase in singular!
There are other languages that maintain 5 or even 6 different plural forms, all depending on which specific number you’ve got in your phrase.
It is better to create a separate string for singular.
Please see:
https://developer.www.ads-software.com/reference/functions/_n/
and subsequent comments.
You can also refer to this topic:
https://www.ads-software.com/support/topic/incorrect-use-of-_n/
https://www.ads-software.com/support/topic/incorrect-use-of-_n-2/
- The topic ‘Incorrect use of _n()’ is closed to new replies.