Open RichardAlmanza opened 1 year ago
With this change, we can add in <root-project>/i18n/<desired-language>.yaml the respective menu translation
<root-project>/i18n/<desired-language>.yaml
For example, let's use the exampleSite in this repo
in exampleSite/config.toml I'll use Spanish
exampleSite/config.toml
defaultContentLanguage = "es"
then I create exampleSite/i18n/es.yaml file, with the following content
exampleSite/i18n/es.yaml
- id: menu.home translation: Inicio - id: menu.features translation: Caracteristicas - id: menu.portfolio translation: Portafolio - id: section.about translation: Acerca de Nosotros
We only need the identifier property in the menu definition in the configuration, thus to translate more sub menus and items, we can add the property
in exampleSite/config.toml I'll add the property to packages
packages
[[menu.main]] name = "Packages" identifier = "item.packages" # new line url = "" weight = 1 parent = "section.marketing"
then I'll add the new translation in exampleSite/i18n/es.yaml
- id: item.packages translation: Paquetes
When there isn't a translation for an ID, it just keeps the name set in the configuration
With this change, we can add in
<root-project>/i18n/<desired-language>.yaml
the respective menu translationFor example, let's use the exampleSite in this repo
in
exampleSite/config.toml
I'll use Spanishthen I create
exampleSite/i18n/es.yaml
file, with the following contentWe only need the identifier property in the menu definition in the configuration, thus to translate more sub menus and items, we can add the property
in
exampleSite/config.toml
I'll add the property topackages
then I'll add the new translation in
exampleSite/i18n/es.yaml
When there isn't a translation for an ID, it just keeps the name set in the configuration