ISO C++ 中有关于 i18n 和 L10n 的好的参考吗?
标准 ISO C++ 中有一个标头(“
ISO C++ 中的国际化和本地化有什么好的参考吗?
There is a header (" < locale > ") in Standard ISO C++.
Is there any good references for Internationalization and localization in ISO C++?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道的最好的来源是:
Standard C++ IOStreams and Locales by Langer and Kraft(它有教程部分和更多参考部分)
Stroustrup 的The C++ 编程语言第三版的某些版本中的附录(其中也可在线),与其说是参考,不如说是用户指南
The best sources I know are:
Standard C++ IOStreams and Locales by Langer and Kraft (it has a tutorial part and a more reference part)
the appendix in some version of the third edition of The C++ Programming Language by Stroustrup (which is also available online) is more a user guide than a reference
the relevant section in the standard is only a reference and not suitable as a user guide.
不。
有关于如何使用 C++ 流和语言环境方面的参考资料...但 ISO C++ 没有提供真正的内部化/本地化的方法。
这个主题比看起来要困难得多,因为某些语言
tolower
方法需要查看整个单词,而不仅仅是当前字符,因为toupper
code> 不是单射的。ll
本身就是一个字母(尽管是两个不同的标记),在字母表中拥有自己的位置。我什至不会从波兰语的序数开始...
如果您确实想要 C++ 中的正确 I18n/L10n,您可以转向 ICU 库,尽管它具有 C 风格的接口,但它是事实上的标准。对于内容翻译,您可能需要查看 GetText(一个 GNU 项目)。可以将两者结合起来以获得国际化资源的翻译和操作,例如翻译项目列表并将其按字母顺序排序。
No.
There are references on how to use C++ streams and the locale facets... but ISO C++ does not provide a way for true Internalization/Localization.
The subject is much more difficult than it appears, because some languages have arcane rules
tolower
method would require looking at the whole word, instead of just the current character becausetoupper
is not injective.ll
is a letter itself (although two distinct tokens), with its own place in the alphabet.And I won't even start on the ordinals in Polish...
If you really want proper I18n/L10n in C++, you may turn toward the ICU library, which despite its C-ish interface, is the de-facto standard. For translation of content, you may want to look at GetText (a GNU project). The two can be combined to obtain both translation and manipulation of internationalized resources, like translating a list of items and rendering it sorted alphabetically.
这里是在线参考手册。
Here is online reference manual.