[Intl] format to feminine ordinal numbers #4307
Unanswered
JorickPepin
asked this question in
Q&A
Replies: 1 comment
-
In the current implementation, i think you'd code it quicker by yourself in a dedicated extension... than with the IntlExtension. As you can see in the createNumberFormatter() method, the only way to set textAttributes would be to inject a $prototype ... but even then, you'd only can set "feminine" or "masculine" once. Or you can try to find another way to add this behaviour line 511 (if the $textAttrs in not usable as right now) foreach ($textAttrs as $name => $value) {
$this->numberFormatters[$hash]->setTextAttribute(self::NUMBER_TEXT_ATTRIBUTES[$name], $value);
}
foreach ($symbols as $name => $value) {
$this->numberFormatters[$hash]->setSymbol(self::NUMBER_SYMBOLS[$name], $value);
}
+ $this->numberFormatters[$hash]->setTextAttribute(self::NUMBER_TEXT_ATTRIBUTES['default_ruleset'], '%digits-ordinal-feminine');
return $this->numberFormatters[$hash];
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As mentioned in this issue, the addition of the Intl extension should have enabled the display of feminine ordinal numbers through the
format_ordinal_number
filter (e.g.1re
instead of1er
in French), but is this really the case? If so, how could this be achieved? Thanks in advance.Beta Was this translation helpful? Give feedback.
All reactions