Hello!
I have found some issues with translations (JomSocial 3.2.0.6 - 3.2.1.1).
For some languages with complex word endings for numeric values JText::plural() should be used instead of JText::sprintf().
In ru-RU language, we have to use several keys for the same phrases to take into account different word endings.
For example:
COM_COMMUNITY_LAPSED_DAYS="%1$s days ago"
would translate into:
COM_COMMUNITY_LAPSED_DAYS="%1$s дней назад"
COM_COMMUNITY_LAPSED_DAYS_1="%1$s день назад"
COM_COMMUNITY_LAPSED_DAYS_2="%1$s дня назад"
COM_COMMUNITY_LAPSED_DAYS_MORE="%1$s дней назад"
We have to use several different keys to cover all endings for each number, not only for value=1 and value>1, but for some other values: value=2, value=3 and etc.
You use "if" in php code for echo BASE lang key or BASE_MANY key, but we need the third variant.
I know that JText::plural() with some override can fix it (use suffixes _1, _2, _MORE).
Example for joomla RU language pack: language\ru-RU\ru-RU.localise.php
abstract class Ru_RULocalise
{
//................
/**
* Returns the potential suffixes for a specific number of items
*
* @param int $count The number of items.
* @return array An array of potential suffixes.
* @since 1.6
*/
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;
}
//................
}
HI, Alexander.
Thank you for your report, I passed it to our developers.
Hi, Alexander.
Here is PO response:
There is no way we can adopt this for all different languages in the word.
His example for romanian, breaks on my language (serbian)
Example
"pre 1 godinu" - singular
"pre 2 godine" - plural
"pre 3 godine" - plural
"pre 4 godine" - plural
"pre 5 godina" <--- ooops.... plural, but in different case
The thing we have now, works the best for all, so changing it will be dangerous