I would like to have an easy to use way to write code like:
#include <iostream>
int main (){
std::cout << "hello, world!\n";
}
but that supports i18n. Here is an example using gettext()
:
#include <libintl.h>
#include <iostream>
int main (){
std::cout << gettext("hello, world!\n");
}
This can then be processed by xgettext to produce a message catalog file that can be used by translators to create various versions. These extra files can be handled on target systems to allow the user to interact in a preferred language.
I would like to write the code something like this instead:
#include <i18n-iostream>
int main (){
i18n::cout << "hello, world!\n";
}
At build time the quoted strings would be examined by a program like xgettext to produce the
base message catalog file. <<
operator with argument i18n::cout
would take a string
literal as the key to lookup the run-time text to use from a message catalog.
Does it exist somewhere?