all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jaming via Guix-patches via <guix-patches@gnu.org>
To: 53711@debbugs.gnu.org
Subject: [bug#53711] [PATCH 1/1] home: services: import i18n module.
Date: Tue, 01 Feb 2022 20:25:37 +0000	[thread overview]
Message-ID: <wurElOHSDi7Ajm9gsAzczB7tKdedfgA8SwfCfwrecUKjUeZCoMoI82OoYiSTHXT9OCjmvuX9Et-zMfaeWy11rzX1x0NtzSzSUKrDVwVKgD0=@protonmail.com> (raw)

From 713a7002c63ad86c36b03656cdd3ec9e350e7480 Mon Sep 17 00:00:00 2001
From: Justin Martin <jaming@protonmail.com>
Date: Tue, 1 Feb 2022 14:48:35 -0500
Subject: [PATCH 1/1] home: services: import i18n module.

* 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.
---
 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 @@ (define-module (gnu home services)
   #: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 @@ (define %initialize-gettext
   #~(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 @@ (define (compute-on-first-login-script _ gexps)
              (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 @@ (define home-activation-service-type
 ;;;

 (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 @@ (define expressions-to-eval
             (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)
--
2.34.0





             reply	other threads:[~2022-02-01 22:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 20:25 Jaming via Guix-patches via [this message]
2022-02-01 21:19 ` [bug#53711] Related Issues Jaming via Guix-patches via
2022-02-04 21:50 ` bug#53711: [PATCH 1/1] home: services: import i18n module Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='wurElOHSDi7Ajm9gsAzczB7tKdedfgA8SwfCfwrecUKjUeZCoMoI82OoYiSTHXT9OCjmvuX9Et-zMfaeWy11rzX1x0NtzSzSUKrDVwVKgD0=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=53711@debbugs.gnu.org \
    --cc=jaming@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.