Handle languages that support _PLURAL_MORE_THAN_TWO

Ex. WEEK_PLURAL, WEEK_PLURAL_MORE_THAN_TWO
This commit is contained in:
Flavio Copes
2015-11-24 15:18:10 +01:00
parent 20f17130a2
commit e00560f81a

View File

@@ -355,6 +355,12 @@ class TwigExtension extends \Twig_Extension
$periods[$j] .= '_PLURAL';
}
if ($this->grav['language']->getTranslation($this->grav['language']->getLanguage(), $periods[$j] . '_MORE_THAN_TWO')) {
if ($difference > 2) {
$periods[$j] .= '_MORE_THAN_TWO';
}
}
$periods[$j] = $this->grav['language']->translate($periods[$j], null, true);
return "$difference $periods[$j] {$tense}";