If unread message bigger that 1, then plural function in mod_status does not work and show me 'MOD_STATUS_MESSAGES'
// $unread = 0;
JText::plural('MOD_STATUS_MESSAGES', $unread) - worked fine and show title "0 Messages"
// $unread = 1;
JText::plural('MOD_STATUS_MESSAGES', $unread) - worked fine and show title "1 Message"
// $unread = 2;
JText::plural('MOD_STATUS_MESSAGES', $unread) - does not work and show title as 'MOD_STATUS_MESSAGES'
// $unread = 3;
JText::plural('MOD_STATUS_MESSAGES', $unread) - does not work and show title as 'MOD_STATUS_MESSAGES'
/administrator/modules/mod_status/tmpl/default.php
PHP 5.6
Joomla 3.4.8
I think you are using Russian and there is a mistake in the Russian language file.
It contains
MOD_STATUS_MESSAGES_0="%d"
MOD_STATUS_MESSAGES_1="%d"
MOD_STATUS_MESSAGES_MORE="%d"
BUT it is missing the string
MOD_STATUS_MESSAGES_2="%d"
I suggest you contact the Russian Translation Team:
http://community.joomla.org/translations/joomla-3-translations.html#ru-ru
@infograf768 - yes, I use russian lang, but also in english also missing the string:
MOD_STATUS_MESSAGES_2="%d"
but for english, when this string missing, worked, but not worked for russian, - why?
If I by have 100 unread message, then I must be for title set from 'MOD_STATUS_MESSAGES_2' to 'MOD_STATUS_MESSAGES_100' language variables??? This is full delirium!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-01-23 11:56:15 |
Closed_By | ⇒ | Bakual |
If I by have 100 unread message, then I must be for title set from 'MOD_STATUS_MESSAGES_2' to 'MOD_STATUS_MESSAGES_100' language variables??? This is full delirium!
It depends on the language which strings you need. Afaik russian has a special plural form which is used for 2, 12, 22, ... . That's the one in the string MOD_STATUS_MESSAGES_2
. The number in that string doesn't reflect the actual number of items. How it is named is decided by the language team and they have code provided in the licalise.php file to return the proper suffix based on item count.
So you 100 items probably just use the MOD_STATUS_MESSAGES_MORE
form if there is no special plural form used for 100 items.
I'm closing this issue as it is an issue with the language pack and not with core.
@remotehelp
Russian has specific code for plural, different from en-GB
The code is in ru-RU.localise.php
public static function getPluralSuffixes($count)
{
if ($count == 0) {
$return = array('0');
} else {
$return = array(($count%10==1 && $count%100!=11 ? '1' : ($count%10>=2 && $count%10<=4 && ($count%100<10 || $count%100>=20) ? '2' : 'MORE')));
}
return $return;
}
Possibilities are 0, 1, 2, MORE
Using the language overrides in admin, you can easily add the missing string:
MOD_STATUS_MESSAGES_2="%d"
and test for yourself
Ok, worked. Thanks to all.
Labels |
Added:
?
|
Which language are you using?
For en-GB or fr-FR it works fine