self: translate-texi-manuals: Add 'available-translations'.
* guix/self.scm (translate-texi-manuals)[build](available-translations): New procedure. Use it rather than directly calling 'find-files' & co.master
parent
cc753650ec
commit
84c37e6368
|
@ -363,12 +363,25 @@ a list of extra files, such as '(\"contributing\")."
|
||||||
translations))))))
|
translations))))))
|
||||||
(cons prefix extras))))
|
(cons prefix extras))))
|
||||||
|
|
||||||
(for-each (lambda (po)
|
(define (available-translations directory domain)
|
||||||
(match (reverse (string-split po #\.))
|
;; Return the list of available translations under DIRECTORY for
|
||||||
((_ lang _ ...)
|
;; DOMAIN, a gettext domain such as "guix-manual". The result is
|
||||||
(translate-texi "guix" po lang
|
;; a list of language/PO file pairs.
|
||||||
#:extras '("contributing")))))
|
(filter-map (lambda (po)
|
||||||
(find-files "." "^guix-manual\\.[a-z]{2}(_[A-Z]{2})?\\.po$"))
|
(let ((base (basename po)))
|
||||||
|
(and (string-prefix? (string-append domain ".")
|
||||||
|
base)
|
||||||
|
(match (string-split base #\.)
|
||||||
|
((_ ... lang "po")
|
||||||
|
(cons lang po))))))
|
||||||
|
(find-files directory
|
||||||
|
"\\.[a-z]{2}(_[A-Z]{2})?\\.po$")))
|
||||||
|
|
||||||
|
(for-each (match-lambda
|
||||||
|
((language . po)
|
||||||
|
(translate-texi "guix" po language
|
||||||
|
#:extras '("contributing"))))
|
||||||
|
(available-translations "." "guix-manual"))
|
||||||
|
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (file)
|
(lambda (file)
|
||||||
|
|
Reference in New Issue