HiDeoo/starlight-blog

i18n integration

Opened this issue · 2 comments

Is your feature request related to a problem?

Summary: Currently, the /blog route generated by the plugin doesn't seem to be supporting an i18n project.
In my project, I have a root locale (fr), and another locale (en) in its own folder, as seen below.

.
├── src/
│   ├── assets/
│   ├── content/
│   │   ├── docs/
│   │   │   ├── en/
│   │   │   │   ├── blog/
│   │   │   │   │   └── first-article.md
│   │   │   │   │   └── second-article.md
│   │   │   │   └── about.mdx
│   │   │   │   └── index.mdx
│   │   │   ├── blog/
│   │   │   │   └── premier-article.md
│   │   │   │   └── deuxieme-article.md
│   │   │   └── a-propos.mdx
│   │   │   └── index.mdx
│   │   └── config.ts
│   └── env.d.ts
├── astro.config.mjs

However, when I try to set up a blog for the other locale (under docs/en/blog) I run into problems.

  • on the home page, I navigate to /blog, then hit the language switch => /en/blog returns 404
  • on the home page, I hit the language switch to get to /en, then navigate to blog => falls back to French /blog/

Describe the solution you'd like

The plug-in should accommodate an i18n setup.
Creating a /blog folder in the different locales folders should generate a blog homepage and link accessible via /locale/blog/

Describe alternatives you've considered

No response

Additional Context

As the plug-in documentation doesn't refer to i18n, I still tried to set up a blog for the other locale (under docs/en/blog), but ran into problems described above.

Thank you for your time.

Thanks for your report 🙌

i18n support is still something on my todo list at the moment. A complete and working solution is not yet something doable without additional improvements in Starlight itself, mostly this proposal.

I guess the 2 choices at hand are:

  • Implement a custom solution right now to at least generate the /blog, /blog/X, /blog/tags/Y pages in various languages by duplicating some Starlight code and having all UI strings in English in all languages.
  • Wait for some progress on the i18n front in Starlight and then implement a proper solution.

Considering I'm planning to start working on some parts of the linked proposal this week, I think I'll wait a bit before making a decision and get a better overview of the situation/timeline.

Considering I'm planning to start working on some parts of the linked proposal this week, I think I'll wait a bit before making a decision and get a better overview of the situation/timeline.

Thank you HiDeoo,
Reading that proposal you linked and realizing this is well above my skill level, there's no much I can do to help, except for French translation when the time comes!
Looking forward to seeing how it goes.