You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The labels['rightSidebar.contribute'] has a type error.
When you run astro check, astro build, or have an editor like vscode with the astro and typescript extensions, you get an error:
src/components/starlight/TableOfContents.astro:21:25 - error ts(7053): Element implicitly has an 'any' type because expression of type '"rightSidebar.contribute"' can't be used to index type '{ "skipLink.label": string; "search.label": string; "search.shortcutLabel": string; "search.cancelLabel": string; "search.devWarning": string; "themeSelect.accessibleLabel": string; "themeSelect.dark": string; ... 30 more ...; "expressiveCode.terminalWindowFallbackTitle"?: string | undefined; }'.
Property 'rightSidebar.contribute' does not exist on type '{ "skipLink.label": string; "search.label": string; "search.shortcutLabel": string; "search.cancelLabel": string; "search.devWarning": string; "themeSelect.accessibleLabel": string; "themeSelect.dark": string; ... 30 more ...; "expressiveCode.terminalWindowFallbackTitle"?: string | undefined; }'.
Lastly, I would have expended the Starlight docs on extending the i18n schema to also tell me how to use the new labels. Sadly they do not. HiDeoo was kind enough in discord to mention instead of using useTranslation starlight internals, I could not use the labels property on the component. This should be documented, preferably in the same section.
Link to Minimal Reproducible Example
N/A
Participation
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
What version of
starlight
are you using?0.21.5
What version of
astro
are you using?4.6.4
What package manager are you using?
pnpm
What operating system are you using?
Ubuntu Linux
What browser are you using?
Firefox
Describe the Bug
After defining a i18n extension in
/src/content/config.ts
per the docs, say like so:Then when you try to use it in a component, like say
TableOfContents.astro
:The
labels['rightSidebar.contribute']
has a type error.When you run
astro check
,astro build
, or have an editor like vscode with the astro and typescript extensions, you get an error:Lastly, I would have expended the Starlight docs on extending the i18n schema to also tell me how to use the new labels. Sadly they do not. HiDeoo was kind enough in discord to mention instead of using
useTranslation
starlight internals, I could not use thelabels
property on the component. This should be documented, preferably in the same section.Link to Minimal Reproducible Example
N/A
Participation
The text was updated successfully, but these errors were encountered: