質問

Many times in my UI programming career I have wanted to represent things like numbers, times, dates and lists correctly according to a given locale.

Are there any libraries that can help?

Cocoa and I'm guessing some Windows framework will help with the locale-appropriate human readable representation of numbers, times and dates. Are there any simple C or other libraries that help do this?

I want to express a list of names, for example James, Chris, Mark and Bob. Of course, the and at the end and the use of the U+002C comma is specific to English, and the lack of Oxford comma probably specific to British English. Are there any libraries that can take care of this? Failing that, are there any resources that document such grammatical constructions in various languages?

役に立ちましたか?

解決

Is formatting a list what you are after?

Because ICU has something like that and it is called ListFormatter. It can format the list of given names appropriately for given language. Both list separator (like comma or semicolon) and lest terminator ("and") will be translated.

他のヒント

Thanks to Paweł Dyda's pointer to ICU, I came across what ICU makes use of - CLDR.

The Unicode CLDR provides key building blocks for software to support the world's languages, with the largest and most extensive standard repository of locale data available. This data is used by a wide spectrum of companies for their software internationalization and localization, adapting software to the conventions of different languages for such common software tasks.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top