From 41efa45508b292d947371dd6b9df943c33727c3d Mon Sep 17 00:00:00 2001 From: Justin Martin Date: Tue, 1 Feb 2022 14:48:35 -0500 Subject: home: services: import i18n module. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by Roland Everaert and Holger Peters . * gnu/home/services.scm (%initialize-gettext): remove setlocale for guile scripts. (compute-on-first-login-script): add module import for i18n. (compute-on-change-gexp): add module import for i18n. Signed-off-by: Ludovic Courtès --- gnu/home/services.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 1c860d7b01..b7ea6f08dd 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -30,6 +30,7 @@ #:use-module (guix discovery) #:use-module (guix diagnostics) #:use-module (guix i18n) + #:use-module (guix modules) #:use-module (srfi srfi-1) #:use-module (ice-9 match) @@ -282,13 +283,13 @@ will be put in @file{~/.guix-home/files}."))) #~(begin (bindtextdomain %gettext-domain (string-append #$guix "/share/locale")) - (textdomain %gettext-domain) - (setlocale LC_ALL ""))) + (textdomain %gettext-domain))) (define (compute-on-first-login-script _ gexps) (program-file "on-first-login" - #~(begin + (with-imported-modules (source-module-closure '((guix i18n))) + #~(begin (use-modules (guix i18n)) #$%initialize-gettext @@ -309,7 +310,7 @@ will be put in @file{~/.guix-home/files}."))) (display (G_ "XDG_RUNTIME_DIR doesn't exists, on-first-login script won't execute anything. You can check if xdg runtime directory exists, XDG_RUNTIME_DIR variable is set to appropriate value and manually execute the -script by running '$HOME/.guix-home/on-first-login'"))))))) +script by running '$HOME/.guix-home/on-first-login'")))))))) (define (on-first-login-script-entry on-first-login) "Return, as a monadic value, an entry for the on-first-login script @@ -401,7 +402,8 @@ with one gexp, but many times, and all gexps must be idempotent."))) ;;; (define (compute-on-change-gexp eval-gexps? pattern-gexp-tuples) - #~(begin + (with-imported-modules (source-module-closure '((guix i18n))) + #~(begin (use-modules (guix i18n)) #$%initialize-gettext @@ -486,7 +488,7 @@ with one gexp, but many times, and all gexps must be idempotent."))) (display (G_ "On-change gexps evaluation finished.\n\n"))) (display "\ On-change gexps won't be evaluated; evaluation has been disabled in the -service configuration")))) +service configuration"))))) (define home-run-on-change-service-type (service-type (name 'home-run-on-change) -- cgit v1.2.3