wax-office-of-inspector-general / wax-developer

WAX Developer Portal - Learn, Build, Operate & Create
https://developer.wax.io
10 stars 52 forks source link

Multilingual site #21

Closed 3dkrender closed 2 years ago

3dkrender commented 2 years ago

Site restructuring to include translations of existing pages. The user will be able to select the reading language at the bottom of any page automatically.

As an example I have started the translation in Spanish. All articles are included but their content is pending translation.

How to add translated pages

To add a translation to this documentation, you must add a folder for the content within docs. Please, use ISO-639-1 codes.

docs/
  en/
    index.md
    ...
  es/
    index.md
    ...
  fr/
    index.md
    ...

Add language reference in docs/_data/languages.yml

Sample for Spanish translation:

es:
  label: Español
  icon: 🇪🇸

Add translations for general labels in docs/_data/translations.yml

Sample for Spanish translation:

back_to_top_text: 
  en: "Back to top"
  es: "Volver arriba"

Add an index_ISO-639-1-CODE.md file in docs/

Sample for Spanish translation:

docs/index_es.md

For each translated file add this parameters in heads:

lang-ref: {same as original Title parameter in default language (en)}
lang: {ISO-639-1 code}

Sample for Spanish translation:

title: Bienvenido
layout: home
nav_order: 1
lang-ref: Welcome
lang: es
rakeden commented 2 years ago

Thanks for taking care of the translations functionality!