Skip to content

Make use of hugo-gettext

Phu Nguyen requested to merge work/hugo-gettext into master
  • Use hugo-gettext for extraction, compilation, and generation, hugo-i18n only needs to care about what hugo-gettext doesn't. It has these advantages:
    • Proper support for shortcodes: shortcodes aren't parsed with regex but with a finite state machine, resulting in the ability to destructure shortcodes and to specify exactly which parameters of each shortcode should be processed
    • Support for attribute list: this is supported by Hugo for titles and blocks, but hasn't been supported by hugo-i18n yet. Resolve #5 (closed)
    • Better support for other element types: while the l10n renderer has a better structure than hugo-i18n's l10n renderer, the i18n is also written as a renderer. These changes make both i18n and l10n of Markdown files more structured, especially the handling of spaces and formatting characters at the beginning of each line is able to handle much more complicated cases.
    • Support for TOML and JSON config files, string files, and data files: hugo-i18n supports only YAML. Resolve #6 (closed)
  • Improve fetch step
    • On the command line, users can list languages to fetch and specify the SVN branch to fetch from
    • The program decides itself how to organize the fetched files based on whether the FILENAME env. var is set
    • Scripty adds "static" to PO file names which are processed statically, we need to add that to the path of the file to get.
Edited by Phu Nguyen

Merge request reports