first commit

This commit is contained in:
Eddy
2014-10-10 17:36:02 +04:00
commit 1a63497f04
62 changed files with 9055 additions and 0 deletions

32
simple_gettext/1.c Normal file
View File

@@ -0,0 +1,32 @@
#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;
}