mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
doc: Allow different translations for 'guix-cookbook' and 'guix-manual'.
Previously, 'guix-manual-text-domain' could be passed the cookbook
language list as its second argument. Thus, it started failing when the
set of cookbook languages was no longer a subset of the manual
languages, starting with commit
93bfd4d9c7
, which removed "sk" from
'guix-manual' but kept it for 'guix-cookbook'.
* doc/build.scm (%manual-languages, %cookbook-languages): New
variables.
(%languages): Use them.
(guix-manual-text-domain): Give LANGUAGES a valid default value.
(localization-helper-module): Remove optional argument to
'guix-manual-text-domain'.
This commit is contained in:
parent
20645d8467
commit
0d0e2165ea
1 changed files with 14 additions and 7 deletions
|
@ -62,11 +62,19 @@ (define %manual
|
|||
(or (getenv "GUIX_MANUAL")
|
||||
"guix"))
|
||||
|
||||
(define %manual-languages
|
||||
;; Available translations for the 'guix-manual' text domain.
|
||||
'("de" "en" "es" "fr" "ru" "zh_CN"))
|
||||
|
||||
(define %cookbook-languages
|
||||
;; Available translations for the 'guix-cookbook' text domain.
|
||||
'("de" "en" "fr" "sk"))
|
||||
|
||||
(define %languages
|
||||
;; The cookbook is not translated in the same languages as the manual
|
||||
;; Available translations for the document being built.
|
||||
(if (string=? %manual "guix-cookbook")
|
||||
'("de" "en" "fr" "sk")
|
||||
'("de" "en" "es" "fr" "ru" "zh_CN")))
|
||||
%cookbook-languages
|
||||
%manual-languages))
|
||||
|
||||
(define (texinfo-manual-images source)
|
||||
"Return a directory containing all the images used by the user manual, taken
|
||||
|
@ -969,7 +977,8 @@ (define (normalize language) ;XXX: deduplicate
|
|||
(computed-file (string-append manual "-pdf-manual") build
|
||||
#:local-build? #f))
|
||||
|
||||
(define (guix-manual-text-domain source languages)
|
||||
(define* (guix-manual-text-domain source
|
||||
#:optional (languages %manual-languages))
|
||||
"Return the PO files for LANGUAGES of the 'guix-manual' text domain taken
|
||||
from SOURCE."
|
||||
(define po-directory
|
||||
|
@ -1042,9 +1051,7 @@ (define* (translate str language
|
|||
(define exp
|
||||
`(begin
|
||||
(bindtextdomain "guix-manual"
|
||||
#+(guix-manual-text-domain
|
||||
source
|
||||
languages))
|
||||
#+(guix-manual-text-domain source))
|
||||
(bindtextdomain "iso_639-3" ;language names
|
||||
#+(file-append iso-codes
|
||||
"/share/locale"))
|
||||
|
|
Loading…
Reference in a new issue