- /* get the local stuff from the environment */
-
- if (strlen(env_lang) <= 2) {
- put("user.language", env_lang);
- }
- else {
- if ((env_lang[2] == '_') && (strlen(env_lang) >= 5)) {
+#if defined(HAVE_SETLOCALE) && defined(HAVE_LC_MESSAGES)
+ /* get the locale stuff from the environment */
+ char *locale;
+
+ if ((locale = setlocale(LC_MESSAGES, ""))) {
+ int len = strlen(locale);
+ if (((len >= 5) && (locale[2] == '_')) || len == 2) {
+ use_en_US = false;