diff options
Diffstat (limited to '')
-rw-r--r-- | module/hnh/util/language.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/module/hnh/util/language.scm b/module/hnh/util/language.scm new file mode 100644 index 00000000..9b61483c --- /dev/null +++ b/module/hnh/util/language.scm @@ -0,0 +1,14 @@ +(define-module (hnh util language) + :export (resolve-language)) + + +;; Locale objects, such as %global-locale, doesn't provide a way to access the language name, +;; This is for procedures which want to handle their translations manually. +(define (resolve-language) + "Returns a two character symbol representing the \"current\" language. e.g. en" + (string->symbol + (string-take + (or (getenv "LC_MESSAGES") + (getenv "LC_ALL") + "en") + 2))) |