From: TAKAHASHI Tamotsu Date: Thu, 1 Jun 2017 20:55:07 +0000 (-0700) Subject: Enable TEXTDOMAINDIR override to make translation testing easier. X-Git-Tag: neomutt-20170609~11^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=544b60dc7ec0046059fac4e46652004fe6bc3c57;p=neomutt Enable TEXTDOMAINDIR override to make translation testing easier. If set, TEXTDOMAINDIR will point to a translation directory instead of using the mutt installation directory. --- 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;