本地化序数
对于 ($rank=0; $rank<100; $rank++) { printf("你的排名:%d%s", $rank, $suffix); 是否
存在 gettext 函数将 $suffix 本地化为当前语言并返回,例如:
Your rank: 0th
Your rank: 1st
Your rank: 2nd
Your rank: 3rd
Your rank: 4th
如果当前语言环境是英语,并且当语言环境设置为其他语言时,数字的正确“序数”形式是其他语言?
谢谢。
for ($rank=0; $rank<100; $rank++)
{
printf("Your rank: %d%s", $rank, $suffix);
}
Does there exist a gettext function to localize $suffix to the current language and return, for example:
Your rank: 0th
Your rank: 1st
Your rank: 2nd
Your rank: 3rd
Your rank: 4th
if the current locale is English, and whatever the correct "ordinal" forms of numbers are in other languages when the locale is set to something else?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,但您可以使用 NumberFormatter
来源:
Not that I know of, but you can use NumberFormatter
Source: