Skip to main content

Internationalization

  • for illustration purposes this documentation is partially localized in German.
  • recommendation: topcis and categories can be used across different locales but should be individually created for each locale, for easier separation
  • a certain folder structure is strongly advised for this type of content!

Is it possible to manage this all solely with page-based frontmatter and permalinks? Have all locales for a certain piece of documentation placed in one place:

Approach 1 (implicit permalinks):
- /docs
  - /y
    - x.json { topic: x }
    - /y
      - y.json { category: y }
      - /doc-1.md
      - /fr
        - fr.json { lang: fr }
        - /doc-1.md
      - /es
        - es.json { lang: es }
        - /doc-1.md

Approach 2 (explicit permalinks):
- /docs
  - /doc-1.md { topic: x, category: y } with default /docs/doc-1/
  - /doc-1-fr.md { topic: x, category: y, lang: fr, permalink: /fr/docs/doc-1/ }
  - /doc-1-es.md { topic: x, category: y, lang: es, permalink: /es/docs/doc-1/ }

Both would allow for individual translations for topics and categories. Approach 1 is a little more setup but less work in the long-run. Approach 2 might make more sense for certain pieces of documentation or as an overall file structure principle.