* keylist.c (list_cert_colon): Kludge to show an email address
[gnupg.git] / util / simple-gettext.c
index 21f3938..80dbbfe 100644 (file)
@@ -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 Registry */
            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;