简体   繁体   English

在ISO C ++中对i18n和L10n有什么好的参考吗?

[英]Is there any good references for i18n and L10n in ISO C++?

There is a header (" < locale > ") in Standard ISO C++. 标准ISO C ++中有一个标题(“<locale>”)。

Is there any good references for Internationalization and localization in ISO C++? ISO 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) Langer和Kraft的标准C ++ IOStreams和Locales (它有一个教程部分和更多参考部分)

  • 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 Stroustrup第三版“C ++编程语言”的某些版本中的附录(也可在线获取 )更多的是用户指南而不是参考

  • the relevant section in the standard is only a reference and not suitable as a user guide. 标准中的相关部分仅供参考,不适合作为用户指南。

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. 有关如何使用C ++流和区域设置方面的参考资料......但ISO C ++没有提供真正的内部化/本地化的方法。

The subject is much more difficult than it appears, because some languages have arcane rules 这个主题比它看起来要困难得多,因为有些语言有神秘的规则

  • in Greek, the tolower method would require looking at the whole word, instead of just the current character because toupper is not injective. 在希腊语中, tolower方法需要查看整个单词,而不仅仅是当前字符,因为toupper不是单射的。
  • in Spanish, ll is a letter itself (although two distinct tokens), with its own place in the alphabet. 在西班牙语中, ll是一个字母本身(虽然是两个不同的标记),在字母表中有自己的位置。

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. 如果你真的想在C ++中使用合适的I18n / L10n,你可能会转向ICU库,尽管它有C-ish接口,它仍然是事实上的标准。 For translation of content, you may want to look at GetText (a GNU project). 对于内容的翻译,您可能需要查看GetText(GNU项目)。 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. 这两者可以组合起来以获得国际化资源的翻译和操作,例如翻译项目列表并按字母顺序对其进行排序。

是在线参考手册。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM