Skip to content

Commit

Permalink
Merge pull request #3937 from DanHeidinga/djh/nls_en
Browse files Browse the repository at this point in the history
Avoid looking up the NLS catalog in en locale's with default msg
  • Loading branch information
charliegracie authored Jun 3, 2019
2 parents f99a06d + 1b50bac commit b91e14d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion port/common/j9nls.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@ j9nls_lookup_message(struct OMRPortLibrary *portLibrary, uintptr_t flags, uint32
omrthread_monitor_enter(nls->monitor);

if (!nls->catalog) {
/* Don't load the catalog if VM is running in an
* english locale and there is a default message
*/
if (NULL != default_string) {
if (0 == strcmp(nls->language, "en")) {
message = default_string;
goto done;
}
}
open_catalog(portLibrary);
}

Expand All @@ -395,7 +404,7 @@ j9nls_lookup_message(struct OMRPortLibrary *portLibrary, uintptr_t flags, uint32
message = J9NLS_ERROR_MESSAGE(J9NLS_PORT_NLS_FAILURE, "NLS Failure\n");
}
}

done:
omrthread_monitor_exit(nls->monitor);
return message;
}
Expand Down

0 comments on commit b91e14d

Please sign in to comment.