]> granicus.if.org Git - mutt/commitdiff
Enable TEXTDOMAINDIR override to make translation testing easier.
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Thu, 1 Jun 2017 20:55:07 +0000 (13:55 -0700)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Thu, 1 Jun 2017 20:55:07 +0000 (13:55 -0700)
If set, TEXTDOMAINDIR will point to a translation directory instead of
using the mutt installation directory.

main.c

diff --git a/main.c b/main.c
index 0d3ea52205e326a1ed3201d08b78b62a7e4a1acf..edb36e06ea7ba2c098d919d0ed003b032ab79081 100644 (file)
--- a/main.c
+++ b/main.c
@@ -608,9 +608,15 @@ int main (int argc, char **argv, char **environ)
   setlocale (LC_ALL, "");
 
 #ifdef ENABLE_NLS
-  /* FIXME what about init.c:1439 ? */
-  bindtextdomain (PACKAGE, MUTTLOCALEDIR);
-  textdomain (PACKAGE);
+  /* FIXME what about the LOCALES_HACK in mutt_init() [init.c] ? */
+  {
+    char *domdir = getenv ("TEXTDOMAINDIR");
+    if (domdir && domdir[0])
+      bindtextdomain (PACKAGE, domdir);
+    else
+      bindtextdomain (PACKAGE, MUTTLOCALEDIR);
+    textdomain (PACKAGE);
+  }
 #endif
 
   mutt_error = mutt_nocurses_error;