From 544b60dc7ec0046059fac4e46652004fe6bc3c57 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Tamotsu Date: Thu, 1 Jun 2017 13:55:07 -0700 Subject: [PATCH] Enable TEXTDOMAINDIR override to make translation testing easier. If set, TEXTDOMAINDIR will point to a translation directory instead of using the mutt installation directory. --- main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 92d00218a..ed013edbf 100644 --- 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; -- 2.49.0