CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
4.89k stars 1.6k forks source link

feat(i18n): Allow localizing menus with i18n dynamically #773

Closed CcydtN closed 1 year ago

CcydtN commented 1 year ago

Adding feature described in this link: https://gohugo.io/content-management/multilingual/#dynamically-localizing-menus-with-i18n

I figure out two issue when adding i18n/[language].toml to the root directory like the link describe. First, the text in sidebar is not changing according to the language file. Even thought "identifier" is added in every element of the menu. Second, clicking the sidebar button after changing language will redirect the page to its default language.

So I modify the corresponding html to solve this two problem.

CaiJimmy commented 1 year ago

Thank you so much for submitting your pull request!

Sorry for the late reply. Unfortunately, I'm still tied up with academic tasks and won't be able to review pull requests for the time being.

Once I have more time, I'll take a look at your pull request and provide feedback.

Thank you again for your contributions!