2014-10-10 17:36:02 +04:00

33 lines
885 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <stdio.h>
#include <libintl.h>
#include <locale.h>
#define _(String) gettext(String)
#define gettext_noop(String) String
#define N_(String) gettext_noop(String)
int main(int argc, char **argv){
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
/*
* To run in GUI bullshit (like qt or gtk) you must do:
* bind_textdomain_codeset(PACKAGE, "UTF8");
*/
textdomain(GETTEXT_PACKAGE);
/*
* In case when you need both GUI and CLI, you should
* do this:
* char*old = bind_textdomain_codeset (PACKAGE, "");
* before printf calling
* To restore GUI hrunicode do
* bind_textdomain_codeset (PACKAGE, old);
* at the end of printf's
*/
/// ðÅÒÅ×ÅÄÅÎÏ ÇÅÔÔÅËÓÔÏÍ\n
printf(_("Translated by gettext\n"));
/// ÷ÐÏÌÎÅ ÒÁÂÏÔÁÅÔ × ÌÀÂÏÊ ËÏÄÉÒÏ×ËÅ\n
printf(_("This works fine in any charset\n"));
return 0;
}