1
首先如何让我下面的例子中工作(从提升网站)的:提升区域C++ - 理解基础
#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文件,但仍然没有工作)。
基本上我想要做的是能够cout一个字符串,如:“操作”, ,然后根据file1/file2它将打印字符串值在该特定文件的id:操作。
我该怎么办呢?
谢谢。