Use i18next for UI strings and add new injectTranslations plugin callback#1923
Use i18next for UI strings and add new injectTranslations plugin callback#1923HiDeoo merged 62 commits intowithastro:mainfrom
i18next for UI strings and add new injectTranslations plugin callback#1923Conversation
* main: i18n(zh-cn): Update docs about synced-tabs (withastro#1834) i18n(zh-cn): Update some docs about withastro#1620 & withastro#1613 (withastro#1835) Add more diagnostic help to error messages thrown by `<Steps>` (withastro#1838) i18n(zh-cn): Update components.mdx (withastro#1836) i18n(zh-cn): Update community-content.mdx (withastro#1833) Improve type checking job (withastro#1831) [ci] format [ci] release (withastro#1832) i18n(ru): update ru.json (withastro#1826) Fix `<Tabs>` sync issue with inconsistent use of `icon` on `<TabItem>` components (withastro#1811) Enable `BASE_URL` tests (withastro#1828)
* main: i18n(zh-cn): Update `components.mdx` translation (withastro#1852)
* main: (45 commits) i18n(tr): add `showcase.mdx` (withastro#1896) [ci] format i18n(zh-cn): Update `authoring-content.md` (withastro#1901) [ci] format [ci] release (withastro#1897) [ci] format i18n(tr): update `authoring-content.md` (withastro#1887) Micro-optimization: clean up `<details>` CSS (withastro#1892) [ci] format i18n(tr): update `components.md` file (withastro#1889) [ci] format i18n(tr): add css-and-tailwind (withastro#1893) [ci] format [ci] release (withastro#1890) Adds custom styles for `<details>` and `<summary>` elements in Markdown content (withastro#1735) Update @astrojs/mdx to v3 (withastro#1846) [ci] format [ci] release (withastro#1869) Add BlueSky social icon (withastro#1871) [ci] format ...
🦋 Changeset detectedLatest commit: 9dad875 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment was marked as outdated.
This comment was marked as outdated.
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
sarah11918
left a comment
There was a problem hiding this comment.
Y'all are just too good at this! I am so happy to see this accomplishment, and really proud to be associated with the quality of work in this project!
One tiny thought I had while reading the changeset, but the docs are fantastic.
| '@astrojs/starlight': minor | ||
| --- | ||
|
|
||
| Overhauls the built-in localization system which is now powered by the [`i18next`](https://www.i18next.com/) library and available to use anywhere in your documentation website. |
There was a problem hiding this comment.
If applicable, it might be worth a note re: if there is anyone who might have a multi-language site who does NOT need to do anything differently.
Does this only affect people who want to access/render the strings themselves, like in new UI elements they build? Is it possible that there are people with very basic sites with multiple languages where the built in "previous/next page" etc. is all they use and will still just work? Or is it assumed that EVERYONE with a multi-language site will need to update?
Overhauls the built-in localization system which is now powered by the [`i18next`](https://www.i18next.com/) library and available to use anywhere in your documentation website.
This update includes more features and potentially breaking changes for those who created custom, translated, UI elements. Starlight's built-in elements available by configuring support for a language have not changed.
Like, that may be totally wrong, but if there's a clean way of saying what people don't have to worry about/update, I think that's helpful to lead in here, especially when there is a breaking change.
There was a problem hiding this comment.
I think this is already clear from the breaking change section? It says this only applies if you were using component overrides.
…callback (withastro#1923) Co-authored-by: Chris Swithinbank <357379+delucis@users.noreply.github.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
This PR is currently based on #1841.
Description
This PR:
injectTranslationsplugin callback for plugins to inject translations to Starlight.Note that the links validation is failing a lot but this is expected as the links validator plugin does not support the configuration syntax based on #1841.
Remaining tasks
examples/custom-plugin/MarkdownContent.astro)starlight: Astro4.14.0forinjectTypes()starlight-docsearch: Latest Starlight as it uses this new feature@astrojs/starlight-docsearchAstro.props.labelswhich now checks that it's not defined anymore (useful during dev but maybe not worth keeping)// TODO(HiDeoo)commentsdocs/src/content/docs/guides/debug-i18next.mdxdocs/src/components/i18next-debug.astrodocs/src/content/i18n/**/*examples/custom-plugin/**/*