improvements for multiple plural support for translations
- calculate the plural number only if the term has multiple plurals - only numbers can be converted to absolute values
This commit is contained in:
parent
ddcae31d48
commit
d2598bac96
@ -87,17 +87,16 @@ namespace Translator {
|
||||
$translation = $default;
|
||||
$plural = 0;
|
||||
|
||||
if (isset($locales[$identifier])) {
|
||||
if (is_array($locales[$identifier])) {
|
||||
foreach ($values as $value) {
|
||||
$value = abs($value);
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$value = abs($value);
|
||||
$plural = (int)$locales['plural']($value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($locales[$identifier])) {
|
||||
if (is_array($locales[$identifier])) {
|
||||
$translation = $locales[$identifier][$plural];
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user