简体   繁体   English

具有GNU gettext,libunistring的C ++ l10n,i18n解决方案

[英]C++ l10n, i18n solution with GNU gettext, libunistring

I'm writing a C++ application which shall be locale independent, so I decided to use UTF-16 as my in-memory representation for strings/texts (the application should be as platform independent as possible). 我正在编写一个C ++应用程序,该应用程序应与语言环境无关,因此我决定使用UTF-16作为字符串/文本的内存中表示形式(该应用程序应尽可能与平台无关)。 For localize the application's messages i want to use GNU's gettext library. 为了本地化应用程序的消息,我想使用GNU的gettext库。 Since this library seems to use GNU's libunistring library internally, i want to use this one too. 由于该库似乎在内部使用GNU的libunistring库,因此我也想使用此库。

Is this a good solution for i18n, l10n? 这对于i18n,l10n是一个好的解决方案吗? I mean it will be a lot of C code in my C++ classes (I don't found a C++ Wrapper for the libunistring library). 我的意思是我的C ++类中将包含很多C代码(我没有为libunistring库找到C ++包装器)。

Stefan 斯特凡

PS: It's my first big C++ application. PS:这是我的第一个大型C ++应用程序。

If it is a gui application written in c++, qt might be a good toolkit to do it in. It includes its own string class and its own internationalization support: 如果它是用c ++编写的gui应用程序,那么qt可能是一个很好的工具包。它包括自己的字符串类和自己的国际化支持:

http://doc.trolltech.com/4.7/internationalization.html . http://doc.trolltech.com/4.7/internationalization.html

Also you can use the core non gui classes by themselves(they are in their own QtCore namespace separate form the QtGui namespace, and there are compiled to separate dynamically linked libraries). 您也可以单独使用核心非gui类(它们位于自己的QtCore命名空间中,与QtGui命名空间分离,并且已编译为单独的动态链接库)。

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

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