guix-artwork/website/po/ietf-tags.scm

27 lines
838 B
Scheme
Raw Normal View History

website: Add custom xgettext to extract from nested sexps for i18n. * website/po/POTFILES: New file. List apps files here. * website/po/LINGUAS: New file. List en_US lingua. * website/po/ietf-tags.scm: New file. Add association for en_US lingua. * website/scripts/sexp-xgettext.scm: New file for generating a POT file. (<keyword-spec>, <po-entry>, <construct-fold-state>): New record types. (combine-duplicate-po-entries, complex-keyword-spec?, parse-scheme-file, po-equal?, write-po-entry, update-ecomments-string!, update-file-name!, update-old-line-number!, update-line-number!, incr-line-number!, incr-line-number-for-each-nl!, current-ref, make-simple-po-entry, matching-keyword, nth-exp, more-than-one-exp?, token->string-symbol-or-keyw, complex-marked-list->po-entries, construct-po-entries, tag, construct-msgid-and-po-entries, scheme-file->po-entries): New procedures. (%keyword-specs, %options, %comments-line, %ecomments-string, %file-name, %old-line-number, %line-number, %files-from-port, %source-files, %output-po-entries, %output-port): New variables. * website/sexp-xgettext.scm: New file with module for looking up translations. (%complex-keywords, %simple-keywords, %plural-numbers, %linguas): New variables. (<construct-fold-state>, <deconstruct-fold-state>): New record types. (set-complex-keywords!, set-simple-keywords!, gettext-keyword?, tag, sexp->msgid, deconstruct): New procedures. (sgettext, spgettext, sngettext, snpgettext): New macro helpers. * website/apps/i18n.scm: New file. (G_, N_, C_, NC_, ietf-tags-file-contents): New syntax to use for i18n. (%current-ietf-tag, %current-lang, %current-lingua): New variables. (builder->localized-builder, builders->localized-builders, localized-root-path, first-value): New utility procedures. (<asset>, <page>): New imports from Haunt. * website/haunt.scm: Wrap each builder to build the locale set in LC_ALL. * website/.guix.scm: Make Haunt build directory writable so Haunt can overwrite duplicate assets. Convert PO files to MO files and build for each lingua. * website/README: Adapt build instructions for i18n. * website/i18n-howto: New file with usage instructions.
2020-07-02 19:17:38 +02:00
;;; This file contains an association list for each translation from
;;; the locale to an IETF language tag to be used in the URL path of
;;; translated pages. The language tag results from the translation
;;; teams language code from
;;; <https://translationproject.org/team/index.html>. The underscore
;;; in the teams code is replaced by a hyphen. For example, az would
;;; be used for the Azerbaijani language (not az-Latn) and zh-CN would
;;; be used for mainland Chinese (not zh-Hans-CN).
(("en_US" . "en")
("cs_CZ" . "cs")
("de_DE" . "de")
("eo" . "eo")
("es_ES" . "es")
("fa_IR" . "fa")
("fr_FR" . "fr")
("ja_JP" . "ja")
("ko_KR" . "ko")
("lt_LT" . "lt")
("nb_NO" . "nb-NO")
("pt_BR" . "pt-BR")
("ru_RU" . "ru")
("sk_SK" . "sk")
("tr_TR" . "tr")
("uk_UA" . "uk")
("zh_CN" . "zh-CN")
("zh_TW" . "zh-TW"))