17 #include <grass/config.h>
21 #include <grass/glocale.h>
24 #if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
25 static char *locale_dir(
void)
27 static char localedir[4096];
33 gisbase =
getenv(
"GISBASE");
34 if (!gisbase || !*gisbase)
37 strcpy(localedir, gisbase);
38 strcat(localedir,
"/locale");
53 char *
G_gettext(
const char *package,
const char *msgid)
55 #if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
56 static char now_bound[4096];
57 static int initialized;
60 setlocale(LC_CTYPE,
"");
61 setlocale(LC_MESSAGES,
"");
65 if (strcmp(now_bound, package) != 0) {
66 strcpy(now_bound, package);
67 bindtextdomain(package, locale_dir());
70 return dgettext(package, msgid);
char * G_gettext(const char *package, const char *msgid)
Gets localized text.