aboutsummaryrefslogtreecommitdiff
path: root/module/hnh
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-07 22:12:29 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-07 22:12:29 +0200
commite377df7b305514d721510fe1f15921647ebc7552 (patch)
tree35dd17aaf5e29c44c0f13401b6cb86e4d7df5acd /module/hnh
parentRename filename-extension{ => ?}. (diff)
parentFix translation for (vcomponent datetime output). (diff)
downloadcalp-e377df7b305514d721510fe1f15921647ebc7552.tar.gz
calp-e377df7b305514d721510fe1f15921647ebc7552.tar.xz
Merge branch 'translation'
Diffstat (limited to 'module/hnh')
-rw-r--r--module/hnh/util/language.scm14
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)))