Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): starlight 0.28.3 introduced some changes to the i18n config #1219

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

zerok
Copy link
Contributor

@zerok zerok commented Nov 4, 2024

Turns out that you now have to explicitly configure the i18n collection if you want to use translation strings. This is the error that we got before the change:

> astro check && astro build

17:20:01 [types] Generated 400ms
17:20:01 [check] Getting diagnostics for Astro files in /home/runner/work/tanka/tanka/docs...
src/components/MobileTableOfContents.astro:17:24 - error ts(23[45](https://github.com/grafana/tanka/actions/runs/11559221997/job/32173402020?pr=1212#step:5:46)): Argument of type '["tableOfContents.onThisPage"]' is not assignable to parameter of type '[key: TemplateStringsArray | TemplateStringsArray[], options?: TOptionsBase & $Dictionary] | [key: string | string[], options: TOptionsBase & ... 1 more ... & { ...; }] | [key: ...]'.
  Type '["tableOfContents.onThisPage"]' is not assignable to type '[key: TemplateStringsArray | TemplateStringsArray[], options?: TOptionsBase & $Dictionary]'.

17        {Astro.locals.t('tableOfContents.onThisPage')}
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/components/TableOfContents.astro:12:54 - error ts(2345): Argument of type '["tableOfContents.onThisPage"]' is not assignable to parameter of type '[key: TemplateStringsArray | TemplateStringsArray[], options?: TOptionsBase & $Dictionary] | [key: string | string[], options: TOptionsBase & ... 1 more ... & { ...; }] | [key: ...]'.
  Type '["tableOfContents.onThisPage"]' is not assignable to type '[key: TemplateStringsArray | TemplateStringsArray[], options?: TOptionsBase & $Dictionary]'.

12     <h2 id="starlight__on-this-page">{Astro.locals.t('tableOfContents.onThisPage')}</h2>
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Result (9 files): 
- 2 errors
- 0 warnings
- 0 hints

The setup worked in 0.28.2 and broke with 0.28.3.

@zerok zerok requested a review from a team as a code owner November 4, 2024 12:56
Copy link
Contributor

github-actions bot commented Nov 4, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-11-04 13:08 UTC

@zerok zerok changed the title fix(docs): Starlight 0.28.3 introduced some changes to the i18n config fix(docs): starlight 0.28.3 introduced some changes to the i18n config Nov 4, 2024
@zerok zerok enabled auto-merge November 4, 2024 12:59
@zerok zerok added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit cb76741 Nov 4, 2024
10 of 11 checks passed
@zerok zerok deleted the zerok/fix-docs-i18n-config branch November 4, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants