Commit Graph

3 Commits

Author SHA1 Message Date
Florian Pelz f66b87373b
website: scripts: Work around failure with guile@3.0.7.
See <https://bugs.gnu.org/49910>.  Keep until the script works with
the Guile referred to in website/manifest.scm.

* website/scripts/sexp-xgettext.scm (token->string-symbol-or-keyw):
Add special case for parsing ",@" tokens.
2021-08-07 12:57:11 +02:00
Julien Lepiller 6489cba5c0
website: Add comments to po and pot files.
* website/scripts/sexp-xgettext.scm (make-simple-po-entry)
(complex-marked-list->po-entries): Add `xml-text' comment for weblate to
enable more checks.
* website/po/guix-website.pot: Update.
2021-04-06 13:17:19 +02:00
Florian Pelz eff4837177
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-26 15:43:01 +02:00