home: services: import i18n module.
Fixes <https://issues.guix.gnu.org/53701>. Reported by Roland Everaert <r.everaert@protonmail.com> and Holger Peters <holger.peters@posteo.de>. * 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 <ludo@gnu.org>
This commit is contained in:
		
							parent
							
								
									04cd0ece62
								
							
						
					
					
						commit
						41efa45508
					
				
					 1 changed files with 8 additions and 6 deletions
				
			
		| 
						 | 
					@ -30,6 +30,7 @@
 | 
				
			||||||
  #:use-module (guix discovery)
 | 
					  #:use-module (guix discovery)
 | 
				
			||||||
  #:use-module (guix diagnostics)
 | 
					  #:use-module (guix diagnostics)
 | 
				
			||||||
  #:use-module (guix i18n)
 | 
					  #:use-module (guix i18n)
 | 
				
			||||||
 | 
					  #:use-module (guix modules)
 | 
				
			||||||
  #:use-module (srfi srfi-1)
 | 
					  #:use-module (srfi srfi-1)
 | 
				
			||||||
  #:use-module (ice-9 match)
 | 
					  #:use-module (ice-9 match)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -282,13 +283,13 @@ will be put in @file{~/.guix-home/files}.")))
 | 
				
			||||||
  #~(begin
 | 
					  #~(begin
 | 
				
			||||||
      (bindtextdomain %gettext-domain
 | 
					      (bindtextdomain %gettext-domain
 | 
				
			||||||
                      (string-append #$guix "/share/locale"))
 | 
					                      (string-append #$guix "/share/locale"))
 | 
				
			||||||
      (textdomain %gettext-domain)
 | 
					      (textdomain %gettext-domain)))
 | 
				
			||||||
      (setlocale LC_ALL "")))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define (compute-on-first-login-script _ gexps)
 | 
					(define (compute-on-first-login-script _ gexps)
 | 
				
			||||||
  (program-file
 | 
					  (program-file
 | 
				
			||||||
   "on-first-login"
 | 
					   "on-first-login"
 | 
				
			||||||
   #~(begin
 | 
					   (with-imported-modules (source-module-closure '((guix i18n)))
 | 
				
			||||||
 | 
					     #~(begin
 | 
				
			||||||
       (use-modules (guix i18n))
 | 
					       (use-modules (guix i18n))
 | 
				
			||||||
       #$%initialize-gettext
 | 
					       #$%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
 | 
					             (display (G_ "XDG_RUNTIME_DIR doesn't exists, on-first-login script
 | 
				
			||||||
won't execute anything.  You can check if xdg runtime directory exists,
 | 
					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
 | 
					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)
 | 
					(define (on-first-login-script-entry on-first-login)
 | 
				
			||||||
  "Return, as a monadic value, an entry for the on-first-login script
 | 
					  "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)
 | 
					(define (compute-on-change-gexp eval-gexps? pattern-gexp-tuples)
 | 
				
			||||||
  #~(begin
 | 
					  (with-imported-modules (source-module-closure '((guix i18n)))
 | 
				
			||||||
 | 
					    #~(begin
 | 
				
			||||||
      (use-modules (guix i18n))
 | 
					      (use-modules (guix i18n))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      #$%initialize-gettext
 | 
					      #$%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 (G_ "On-change gexps evaluation finished.\n\n")))
 | 
				
			||||||
          (display "\
 | 
					          (display "\
 | 
				
			||||||
On-change gexps won't be evaluated; evaluation has been disabled in the
 | 
					On-change gexps won't be evaluated; evaluation has been disabled in the
 | 
				
			||||||
service configuration"))))
 | 
					service configuration")))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define home-run-on-change-service-type
 | 
					(define home-run-on-change-service-type
 | 
				
			||||||
  (service-type (name 'home-run-on-change)
 | 
					  (service-type (name 'home-run-on-change)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue