on-internet
← Community

Why are my gettext translations not appearing?

Stack Overflow ·

I am learning gettext and trying to use it from first principles (no make files, configure.in files etc). I have this C program. #include <locale.h> #include <libintl.h> #include <stdio.h> #define PACKAGE "messages" #define LOCALEDIR "./locale/" int main(int argc, char *argv[]) { setlocale(LC_ALL,""); //also tried //setlocale(LC_ALL,"de"); bindtextdomain(PACKAGE, LOCALEDIR); //also tried adding //bind_textdomain_codeset(PACKAGE, "UFT-8"); textdomain(PACKAGE); printf(gettext("Hello World\n")); return 0; } I created the initial messages.pot (portable object template) xgettext -d messages -p loca

Comments

Sign in or sign up to comment and upvote.

No comments yet.