aboutsummaryrefslogtreecommitdiff
path: root/module/hnh
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-22 18:02:12 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-22 21:08:41 +0100
commit3c9b8911b5952afe6ad69d04fbcbb7169bb0db3c (patch)
tree900ef1faeeb9905576dd2f0ac31e0d3d6d537ef3 /module/hnh
parentUpdate (text module) to dispatch. (diff)
downloadcalp-3c9b8911b5952afe6ad69d04fbcbb7169bb0db3c.tar.gz
calp-3c9b8911b5952afe6ad69d04fbcbb7169bb0db3c.tar.xz
Fix modularization of recurrence display.
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)))