[GRASS-SVN] r40727 - grass/trunk/general/g.parser

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 28 15:38:37 EST 2010


Author: glynn
Date: 2010-01-28 15:38:36 -0500 (Thu, 28 Jan 2010)
New Revision: 40727

Modified:
   grass/trunk/general/g.parser/main.c
Log:
Allow scripts to specify translation domain


Modified: grass/trunk/general/g.parser/main.c
===================================================================
--- grass/trunk/general/g.parser/main.c	2010-01-28 15:29:33 UTC (rev 40726)
+++ grass/trunk/general/g.parser/main.c	2010-01-28 20:38:36 UTC (rev 40727)
@@ -51,12 +51,24 @@
    If global variable to output strings for translation is set it spits them out */
 char *translate(const char *arg)
 {
+    static const char *domain;
+
     if (*arg && translate_output) {
 	fputs(arg, stdout);
 	fputs("\n", stdout);
     }
 
-    return _(arg);
+#if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
+    if (!domain) {
+	domain = getenv("GRASS_TRANSLATION_DOMAIN");
+	if (!domain)
+	    domain = PACKAGE;
+    }
+
+    return G_gettext(domain, arg);
+#else
+    return arg;
+#endif
 }
 
 static void parse_toplevel(struct context *ctx, const char *cmd)



More information about the grass-commit mailing list