tauri-apps / tauri-docs

The source for all Tauri project documentation.

Home Page:https://tauri.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dklassic opened this issue ยท comments

๐Ÿ“‹ 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? ๐Ÿ‘€

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

import locales from '../../locales.json';

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.

Tried filing an upstream feature request here:

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.