aboutsummaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm11
1 files changed, 11 insertions, 0 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 761b1ce444..3ec7be771b 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -26,6 +26,7 @@
#:use-module (ice-9 match)
#:export (_
N_
+ install-locale
leave
show-version-and-exit
show-bug-report-information
@@ -45,6 +46,16 @@
(define _ (cut gettext <> %gettext-domain))
(define N_ (cut ngettext <> <> <> %gettext-domain))
+(define (install-locale)
+ "Install the current locale settings."
+ (catch 'system-error
+ (lambda _
+ (setlocale LC_ALL ""))
+ (lambda args
+ (format (current-error-port)
+ (_ "warning: failed to install locale: ~a~%")
+ (strerror (system-error-errno args))))))
+
(define-syntax-rule (leave fmt args ...)
"Format FMT and ARGS to the error port and exit."
(begin