diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-07 22:12:29 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-07 22:12:29 +0200 |
commit | e377df7b305514d721510fe1f15921647ebc7552 (patch) | |
tree | 35dd17aaf5e29c44c0f13401b6cb86e4d7df5acd /module/hnh/util | |
parent | Rename filename-extension{ => ?}. (diff) | |
parent | Fix translation for (vcomponent datetime output). (diff) | |
download | calp-e377df7b305514d721510fe1f15921647ebc7552.tar.gz calp-e377df7b305514d721510fe1f15921647ebc7552.tar.xz |
Merge branch 'translation'
Diffstat (limited to 'module/hnh/util')
-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))) |