Skip to content

Conversation

@RichardAlmanza
Copy link

With this change, we can add in <root-project>/i18n/<desired-language>.yaml the respective menu translation

For example, let's use the exampleSite in this repo

in exampleSite/config.toml I'll use Spanish

defaultContentLanguage = "es"

then I create exampleSite/i18n/es.yaml file, with the following content

- 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

[[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

dependabot bot added 2 commits January 8, 2023 03:18
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant