tauri-apps / tauri-docs

The source for all Tauri project documentation.
https://tauri.app
MIT License
828 stars 627 forks source link

[2.0] Add Starlight i18n VS Code extension recommendation in translating guide #1776

Open dklassic opened 10 months ago

dklassic commented 10 months ago

πŸ“‹ Explain your issue

So after @lorenzolewis mentioned the existence of Starlight i18n VS Code extension a while ago, I took a look at it and it does work as intended and would surely help a lot for contributors.

Only catch is that by default it tries to find locale setting directly inside Astro config and cannot reference to our locales.json. So the question would be should we change our config so that Starlight i18n would work by default, or should we try to open an upstream issue at HiDeoo/starlight-i18n for overriding and also maybe try to fix it ourselves? πŸ‘€

lorenzolewis commented 10 months ago

I think the only reason it's outside of that is because it's used here:

https://github.com/tauri-apps/tauri-docs/blob/540bc7d12b9ae6389cdb1f101deeb7a0da72af9e/packages/i18n-tracker/build.ts#L2

It might be possible to just import it from the Astro config inside of the i18n-tracker package but I haven't given it a shot yet.

Nonetheless, I think an upstream feature request would be beneficial here because I've seen other projects have to access the i18n data via things like a CI pipeline and keeping it as a JSON file like this could be the easiest way to get access to it with things like GitHub runners.

I've also been keeping an eye on https://github.com/Yan-Thomas/lunaria which is essentially the code that i18n-tracker is but properly split out into a proper project. That looks like it would also expect the locales in https://lunaria.dev/manual-installation#3-configure-the-package.

dklassic commented 10 months ago

Tried filing an upstream feature request here:

dklassic commented 10 months ago

Good news, Starlight-i18n will be adding support for reading external locale json without any extra setup on next release, so now that we won’t be needing changes from our end, I’m updating the issue title to reflect it better.