hbstack / theme

HB starter theme for blog, docs, digital garden, gallery and landing pages. HB 新手博客、文档、数字花园、图库和落地页主题。
https://theme.hbstack.dev/
MIT License
81 stars 19 forks source link

Append the language code to the filename. #218

Open razonyang opened 1 year ago

razonyang commented 1 year ago
VM-137 commented 11 months ago

Hello, I have a simple question about the languages in the starter theme, I have created index.es.md, _index.es.md, menus.es.yaml and params.es.yaml where it needs to be, but I have this problem that text in "featured-posts-tab" and "recent-posts-tab" disappear. Screenshot from 2023-12-01 15-51-41 Can you give me a hint? Thanks

razonyang commented 11 months ago

@VM-137 Hmm, that's weird, it should use en as fallback, do you have a public repo for reproducing the issue?

razonyang commented 11 months ago

@VM-137 Confirmed, it was caused by the missing translations, for now, you can preserve the defaultContentLanguage as en, and configure your langauge in languages.yaml, so that it will fallback to use en translations.

To support es language translations, please see the i18n guide for details.

razonyang commented 11 months ago

@VM-137 Should fixed in modules/sidebar/posts: v0.6.1.

hugo mod get github.com/hbstack/blog/modules/sidebar/posts@v0.6.1

It use English as fallback translations, please feel free to change it in https://github.com/hbstack/blog/blob/main/modules/sidebar/posts/i18n/es.toml.

VM-137 commented 11 months ago

I will be waiting for the v0.6.1, and collaborate translating the i18n files to "es" , thanks.

@VM-137 Should fixed in modules/sidebar/posts: v0.6.1.

hugo mod get github.com/hbstack/blog/modules/sidebar/posts@v0.6.1

It use English as fallback translations, please feel free to change it in https://github.com/hbstack/blog/blob/main/modules/sidebar/posts/i18n/es.toml.

Done.