mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-02 09:28:57 -05:00
self: translate-texi-manuals: Don't hardcode "guix.texi".
* guix/self.scm (translate-texi-manuals)[build](translate-texi): Add 'prefix' and #:extras parameters and honor them. Adjust callers.
This commit is contained in:
parent
cb26edc8f6
commit
cc753650ec
1 changed files with 24 additions and 24 deletions
|
@ -340,34 +340,34 @@ (define (translate-cross-references content translations)
|
||||||
'pre "ref{" msgstr "}" 'post))))))
|
'pre "ref{" msgstr "}" 'post))))))
|
||||||
content translations))
|
content translations))
|
||||||
|
|
||||||
(define (translate-texi po lang)
|
(define* (translate-texi prefix po lang
|
||||||
"Translate the manual for one language LANG using the PO file."
|
#:key (extras '()))
|
||||||
|
"Translate the manual for one language LANG using the PO file.
|
||||||
|
PREFIX must be the prefix of the manual, 'guix' or 'guix-cookbook'. EXTRAS is
|
||||||
|
a list of extra files, such as '(\"contributing\")."
|
||||||
(let ((translations (call-with-input-file po read-po-file)))
|
(let ((translations (call-with-input-file po read-po-file)))
|
||||||
(translate-tmp-texi po "guix.texi"
|
(for-each (lambda (file)
|
||||||
(string-append "guix." lang ".texi.tmp"))
|
(translate-tmp-texi po (string-append file ".texi")
|
||||||
(translate-tmp-texi po "contributing.texi"
|
(string-append file "." lang
|
||||||
(string-append "contributing." lang ".texi.tmp"))
|
".texi.tmp")))
|
||||||
(let* ((texi-name (string-append "guix." lang ".texi"))
|
(cons prefix extras))
|
||||||
(tmp-name (string-append texi-name ".tmp")))
|
|
||||||
(with-output-to-file texi-name
|
(for-each (lambda (file)
|
||||||
(lambda _
|
(let* ((texi (string-append file "." lang ".texi"))
|
||||||
(format #t "~a"
|
(tmp (string-append texi ".tmp")))
|
||||||
|
(with-output-to-file texi
|
||||||
|
(lambda ()
|
||||||
|
(display
|
||||||
(translate-cross-references
|
(translate-cross-references
|
||||||
(call-with-input-file tmp-name get-string-all)
|
(call-with-input-file tmp get-string-all)
|
||||||
translations)))))
|
translations))))))
|
||||||
(let* ((texi-name (string-append "contributing." lang ".texi"))
|
(cons prefix extras))))
|
||||||
(tmp-name (string-append texi-name ".tmp")))
|
|
||||||
(with-output-to-file texi-name
|
|
||||||
(lambda _
|
|
||||||
(format #t "~a"
|
|
||||||
(translate-cross-references
|
|
||||||
(call-with-input-file tmp-name get-string-all)
|
|
||||||
translations)))))))
|
|
||||||
|
|
||||||
(for-each (lambda (po)
|
(for-each (lambda (po)
|
||||||
(match (reverse (string-split po #\.))
|
(match (reverse (string-split po #\.))
|
||||||
((_ lang _ ...)
|
((_ lang _ ...)
|
||||||
(translate-texi po lang))))
|
(translate-texi "guix" po lang
|
||||||
|
#:extras '("contributing")))))
|
||||||
(find-files "." "^guix-manual\\.[a-z]{2}(_[A-Z]{2})?\\.po$"))
|
(find-files "." "^guix-manual\\.[a-z]{2}(_[A-Z]{2})?\\.po$"))
|
||||||
|
|
||||||
(for-each
|
(for-each
|
||||||
|
|
Loading…
Reference in a new issue