diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | src/locale.c | 21 |
2 files changed, 4 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac index 64384b3..ea300fa 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,8 @@ funcs_missing=false AC_CHECK_FUNCS( [\ alphasort calloc dirname free isspace malloc printf putchar \ - realpath scandir sscanf strcasecmp strcmp strdup strndup vprintf + realpath scandir setlocale sscanf strcasecmp strcmp strdup \ + strndup vprintf ], [], [funcs_missing=true]) diff --git a/src/locale.c b/src/locale.c index c5ef596..d738084 100644 --- a/src/locale.c +++ b/src/locale.c @@ -17,28 +17,11 @@ * along with Dodge Balls. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdlib.h> +#include <locale.h> #include "locale.h" const char * db_lc_messages_get(void) { - static char *lang; - - lang = getenv("LC_ALL"); - if (lang != NULL && lang[0] != '\0') { - return lang; - } - - lang = getenv("LC_MESSAGES"); - if (lang != NULL && lang[0] != '\0') { - return lang; - } - - lang = getenv("LANG"); - if (lang != NULL && lang[0] != '\0') { - return lang; - } - - return (lang = NULL); + return setlocale(LC_MESSAGES, ""); } |