首先,如何使以下示例工作(来自boost网站):
#include <boost/locale.hpp>
#include <iostream>
using namespace std;
using namespace boost::locale;
int main()
{
generator gen;
// Specify location of dictionaries
gen.add_messages_path(".");
gen.add_messages_domain("hello");
// Generate locales and imbue them to iostream
locale::global(gen(""));
cout.imbue(locale());
// Display a message using current system locale
cout << translate("Hello World") << endl;
}(尝试创建一个hello.mo文件,但仍然没有工作)。
基本上,我所要做的是能够将字符串显示为:“a”,然后根据file1 / file2,它将在id:a下为该特定文件打印字符串值。
我怎么能这么做?
谢谢。
发布于 2014-04-02 13:10:24
boost翻译: po文件不工作可能会有帮助。
最令人困惑的一步是:
它是GNU 'gettext‘实用程序的包装。手册也很有用。
https://stackoverflow.com/questions/19524013
复制相似问题