hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

Localize menu items with translation tables

Open paradoja opened this issue 2 years ago • 1 comments
trafficstars

What does this PR change? What problem does it solve?

In the Hugo documentation it explains using translation tables as a possible way of localizing menu entries.

This basically uses the menu identifier as a language key for the name of the entry, and is present in the example menu template.

This change basically gives the same functionality to PaperMod.

Was the change discussed in an issue or in the Discussions before?

Not really. I searched for it and was going to ask. But the change is so minuscule that I thought opening the PR would be easier (and if there's a discussion it can happen anyway here).

PR Checklist

  • [ ] This change adds/updates translations and I have used the template present here.
  • [x] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [ ] This change adds a Social Icon which has a permissive license to use it.
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.
  • [ ] This change updates the overridden internal templates from HUGO's repository.

paradoja avatar Aug 14 '23 19:08 paradoja

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Aug 14 '23 19:08 sonarqubecloud[bot]

Adding menu translations at translation tables and rest of config in config.yml may have very less use cases. Instead we are adding them to config itself like this:

https://github.com/adityatelange/hugo-PaperMod/blob/4bdc993b98cc82d1c59efca0774f85811b0bf213/config.yml#L22-L67

adityatelange avatar Mar 08 '24 05:03 adityatelange