installer: Translate keyboard layout names.

* gnu/installer.scm (installer-program)[installer-builder]: Call
'bindtextdomain' for "xkeyboard-config".
* gnu/installer/newt/keymap.scm (run-keymap-page): Add calls to
'gettext'.
This commit is contained in:
Ludovic Courtès 2019-04-17 15:11:21 +02:00
parent 085e021e63
commit feaa83a377
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 10 additions and 4 deletions

View file

@ -353,6 +353,10 @@ (define installer-builder
(bindtextdomain "iso_3166-1" ;territories (bindtextdomain "iso_3166-1" ;territories
#+(file-append iso-codes "/share/locale")) #+(file-append iso-codes "/share/locale"))
;; Likewise for XKB keyboard layout names.
(bindtextdomain "xkeyboard-config"
#+(file-append xkeyboard-config "/share/locale"))
(let* ((current-installer newt-installer) (let* ((current-installer newt-installer)
(steps (#$steps current-installer))) (steps (#$steps current-installer)))
((installer-init current-installer)) ((installer-init current-installer))

View file

@ -97,7 +97,8 @@ (define keymap-steps
(run-layout-page (run-layout-page
(sort-layouts layouts) (sort-layouts layouts)
(lambda (layout) (lambda (layout)
(x11-keymap-layout-description layout)))))) (gettext (x11-keymap-layout-description layout)
"xkeyboard-config"))))))
;; Propose the user to select a variant among those supported by the ;; Propose the user to select a variant among those supported by the
;; previously selected layout. ;; previously selected layout.
(installer-step (installer-step
@ -111,15 +112,16 @@ (define keymap-steps
(run-variant-page (run-variant-page
(sort-variants variants) (sort-variants variants)
(lambda (variant) (lambda (variant)
(x11-keymap-variant-description (gettext (x11-keymap-variant-description variant)
variant)))))))))) "xkeyboard-config"))))))))))
(define (format-result result) (define (format-result result)
(let ((layout (x11-keymap-layout-name (let ((layout (x11-keymap-layout-name
(result-step result 'layout))) (result-step result 'layout)))
(variant (and=> (result-step result 'variant) (variant (and=> (result-step result 'variant)
(lambda (variant) (lambda (variant)
(x11-keymap-variant-name variant))))) (gettext (x11-keymap-variant-name variant)
"xkeyboard-config")))))
(list layout (or variant "")))) (list layout (or variant ""))))
(format-result (format-result
(run-installer-steps #:steps keymap-steps))) (run-installer-steps #:steps keymap-steps)))