natSystem.cc (init_properties): Only look for default locale if LC_MESSAGES is defined.
* java/lang/natSystem.cc (init_properties): Only look for default locale if LC_MESSAGES is defined. * aclocal.m4, configure, include/config.h.in: Rebuilt. * configure.in: Call AM_LC_MESSAGES. * acinclude.m4 (AM_LC_MESSAGES): New macro. From-SVN: r48781
This commit is contained in:
parent
3e92902c7e
commit
999825b056
6 changed files with 282 additions and 188 deletions
|
@ -414,11 +414,12 @@ java::lang::System::init_properties (void)
|
|||
#endif /* HAVE_GETCWD */
|
||||
|
||||
// Set user locale properties based on setlocale()
|
||||
#ifdef HAVE_SETLOCALE
|
||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||
// We let the user choose the locale. However, since Java differs
|
||||
// from POSIX, we arbitrarily pick LC_MESSAGES as determining the
|
||||
// Java locale. We can't use LC_ALL because it might return a full
|
||||
// list of all the settings.
|
||||
// list of all the settings. If we don't have LC_MESSAGES then we
|
||||
// just default to `en_US'.
|
||||
setlocale (LC_ALL, "");
|
||||
char *locale = setlocale (LC_MESSAGES, "");
|
||||
if (locale && strlen (locale) >= 2)
|
||||
|
@ -438,7 +439,7 @@ java::lang::System::init_properties (void)
|
|||
}
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_SETLOCALE */
|
||||
#endif /* HAVE_SETLOCALE and HAVE_LC_MESSAGES */
|
||||
{
|
||||
SET ("user.language", "en");
|
||||
SET ("user.region", "US");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue