]> granicus.if.org Git - neomutt/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)
committerRichard Russon <rich@flatcap.org>
Wed, 7 Jun 2017 21:53:18 +0000 (22:53 +0100)
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 92d00218a25137526b6bceb9686dd7a9786be073..ed013edbf2214c3b6ed300254068d18612b077e6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -211,9 +211,15 @@ int main(int argc, char **argv, char **env)
   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;