【发布时间】:2015-12-08 10:52:23
【问题描述】:
我希望能够格式化(多语言)句子,例如:
I have 12,345 widgets.
在我的 .po 中有
msgid "I only have %d widget."
msgid_plural "I have %d widgets."
msgstr[0] "I don't have any widgets."
msgstr[1] "I only have %d widget."
msgstr[2] "I have %d widgets."
ngettext("I only have %d widget.", "I have %d widgets.", 12345);
如果我使用 number_format(12345),我会返回一串 "12,345",它不能用于检测复数 (the docs say that it must be an int)。
有没有办法让gettext 提供一个格式化的号码?
【问题讨论】:
标签: php multilingual gettext