?
avatar remotehelp
remotehelp
23 Jan 2016

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

#8959

avatar remotehelp remotehelp - open - 23 Jan 2016
avatar infograf768
infograf768 - comment - 23 Jan 2016

Which language are you using?
For en-GB or fr-FR it works fine
screen shot 2016-01-23 at 08 40 43

avatar infograf768
infograf768 - comment - 23 Jan 2016

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

avatar remotehelp
remotehelp - comment - 23 Jan 2016

@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?

avatar remotehelp
remotehelp - comment - 23 Jan 2016

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!

avatar Bakual Bakual - close - 23 Jan 2016
avatar brianteeman brianteeman - close - 23 Jan 2016
avatar Bakual Bakual - change - 23 Jan 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-01-23 11:56:15
Closed_By Bakual
avatar Bakual Bakual - close - 23 Jan 2016
avatar Bakual
Bakual - comment - 23 Jan 2016

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.

avatar infograf768
infograf768 - comment - 24 Jan 2016

@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

avatar remotehelp
remotehelp - comment - 24 Jan 2016

Ok, worked. Thanks to all.

avatar brianteeman brianteeman - change - 22 Apr 2016
Labels Added: ?

Add a Comment

Login with GitHub to post a comment