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
|
|
|
|
|
;;; team’s language code from
|
|
|
|
|
;;; <https://translationproject.org/team/index.html>. The underscore
|
|
|
|
|
;;; in the team’s 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).
|
2020-07-15 08:22:32 +02:00
|
|
|
|
(("en_US" . "en")
|
2023-05-10 22:46:37 +02:00
|
|
|
|
("cs_CZ" . "cs")
|
2020-11-04 14:57:16 +01:00
|
|
|
|
("de_DE" . "de")
|
2021-04-06 13:14:07 +02:00
|
|
|
|
("eo" . "eo")
|
2020-12-25 11:27:33 +01:00
|
|
|
|
("es_ES" . "es")
|
2023-05-31 20:42:25 +02:00
|
|
|
|
("fa_IR" . "fa")
|
2021-01-24 21:27:33 +01:00
|
|
|
|
("fr_FR" . "fr")
|
2022-04-09 11:52:50 +02:00
|
|
|
|
("ja_JP" . "ja")
|
2021-04-06 13:27:53 +02:00
|
|
|
|
("ko_KR" . "ko")
|
2023-05-10 22:46:37 +02:00
|
|
|
|
("lt_LT" . "lt")
|
2022-07-17 19:57:11 +02:00
|
|
|
|
("nb_NO" . "nb-NO")
|
2022-09-17 12:03:35 +02:00
|
|
|
|
("pt_BR" . "pt-BR")
|
2021-04-06 13:30:54 +02:00
|
|
|
|
("ru_RU" . "ru")
|
2021-05-02 01:06:44 +02:00
|
|
|
|
("sk_SK" . "sk")
|
2021-09-02 03:40:57 +02:00
|
|
|
|
("tr_TR" . "tr")
|
2023-07-31 23:39:02 +02:00
|
|
|
|
("uk_UA" . "uk")
|
2021-09-02 03:42:33 +02:00
|
|
|
|
("zh_CN" . "zh-CN")
|
|
|
|
|
("zh_TW" . "zh-TW"))
|