mirror of
https://github.com/getgrav/grav.git
synced 2026-02-06 14:50:23 +01:00
Handle languages that support _PLURAL_MORE_THAN_TWO
Ex. WEEK_PLURAL, WEEK_PLURAL_MORE_THAN_TWO
This commit is contained in:
@@ -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}";
|
||||
|
||||
Reference in New Issue
Block a user