diff options
Diffstat (limited to 'util/simple-gettext.c')
-rw-r--r-- | util/simple-gettext.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/util/simple-gettext.c b/util/simple-gettext.c index 21f39382d..a45ecb2b2 100644 --- a/util/simple-gettext.c +++ b/util/simple-gettext.c @@ -242,19 +242,21 @@ set_gettext_file( const char *filename ) #endif ) { /* absolute path - use it as is */ - log_info("trying `%s'\n", filename ); domain = load_domain( filename ); } - else { /* relative path - append ".mo" and get DIR from env */ + else { /* relative path - append ".mo" and get dir from the environment */ char *buf = NULL; - const char *s; + char *dir; - s = getenv("MINGW32_NLS_DIR"); - if( s && (buf=malloc(strlen(s)+strlen(filename)+1+3+1)) ) { - strcpy(stpcpy(stpcpy(stpcpy( buf, s),"/"), filename),".mo"); + dir = read_w32_registry_string( NULL, + "Control Panel\\Mingw32\\NLS", + "MODir" ); + if( dir && (buf=malloc(strlen(dir)+strlen(filename)+1+3+1)) ) { + strcpy(stpcpy(stpcpy(stpcpy( buf, dir),"/"), filename),".mo"); domain = load_domain( buf ); free(buf); } + free(dir); } if( !domain ) return -1; |