restructurization

This commit is contained in:
2026-05-28 14:23:39 +03:00
parent aca7e3617d
commit b493b36948
211 changed files with 28 additions and 161 deletions

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;
}