#include "gl/c-ctype.h"
#include "gl/c-strcase.h"
#include "gl/localcharset.h"
+#include <gl/localename.h>
#include "gl/minmax.h"
#include "gl/xalloc.h"
#include "gl/relocatable.h"
default_encoding = xstrdup (enc);
}
+/* Return the ISO two letter code for the current LC_MESSAGES
+ locale category. */
+char *
+get_language (void)
+{
+ const char *localename = gl_locale_name (LC_MESSAGES, "LC_MESSAGES");
+ if (0 == strcmp (localename, "C"))
+ return NULL;
+ char *ln = xstrdup (localename);
+ char *end = strchr (ln, '_');
+ if (end)
+ *end = '\0';
+ return ln;
+}
+
/* Attempts to set the encoding from a locale name
returns true if successful.
struct encoding_category *get_encoding_categories (void);
size_t get_n_encoding_categories (void);
+/* Return the ISO two letter code for the current LC_MESSAGES
+ locale category. */
+char *get_language (void);
+
#endif /* i18n.h */