Simple multi language example for console program.
I can't recall if is it shown before?
#include <stdio.h>
#include <stdlib.h>
char *aMsgEN[] = {"MsgEN1\n","MsgEN2\n"};
char *aMsgGE[] = {"MsgGE1\n","MsgGE2\n"};
char **aMsg = aMsgEN;
int main(int argc, char **argv)
{
char *lang = getenv("LANG");
printf(aMsg[0]);
printf("%s %04X\n", lang, *(unsigned short*)lang);
//if (lang[0] == 'G' && lang[1] == 'E') {
if (*(unsigned short*)lang == *(unsigned short*)"GE") {
aMsg = aMsgGE;
printf(aMsg[0]);
}
return 0;
}