开发者

Producing lists in Intl/ICU with PHP

开发者 https://www.devze.com 2023-04-07 21:04 出处:网络
I\'m using P开发者_运维问答HP 5.3\'s Intl extension for formatting strings on my website. However, I have happened upon a string that requires a list of items. The list given to the website can be any

I'm using P开发者_运维问答HP 5.3's Intl extension for formatting strings on my website. However, I have happened upon a string that requires a list of items. The list given to the website can be any number of items, and should appear in however the language renders lists. In English, it would appear as "a, b, c, and d" or "a, b, c, d, e, f, g, and h". Rendering this English form is easy enough, but I don't know if this is a generic, international way of producing lists (I would bet that it isn't). Is there some way to do this with the intl extension, or ICU formatting?


so, CLDR (from which ICU data comes) does have lists. However, it is not implemented in ICU yet- it's scheduled for ICU v49 (March, 2012) for both ICU4J and ICU4C. Then, php intl will need to pick it up. You might file a bug now on php intl to start tracking this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号