diff --git a/packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi.test.ts b/packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi.test.ts index 0605cb6f16..b53a285342 100644 --- a/packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi.test.ts +++ b/packages/core-app-api/src/apis/implementations/TranslationApi/I18nextTranslationApi.test.ts @@ -360,7 +360,9 @@ describe('I18nextTranslationApi', () => { await new Promise(resolve => { const subscription = translationApi.translation$(plainRef).subscribe({ next(snapshot) { - const translation = snapshot.ready ? snapshot.t('foo') : null; + const translation = snapshot.ready + ? (snapshot.t('foo') as string) + : null; translations.push(translation); if (translation === 'foo') { diff --git a/packages/core-plugin-api/alpha-api-report.md b/packages/core-plugin-api/alpha-api-report.md index bea27cfa5e..d50bb0abd6 100644 --- a/packages/core-plugin-api/alpha-api-report.md +++ b/packages/core-plugin-api/alpha-api-report.md @@ -41,7 +41,7 @@ export function createTranslationMessages< // @alpha (undocumented) export function createTranslationRef< TId extends string, - TMessages extends { + const TMessages extends { [key in string]: string; }, TTranslations extends { diff --git a/packages/core-plugin-api/src/translation/TranslationMessages.test.ts b/packages/core-plugin-api/src/translation/TranslationMessages.test.ts index 5314c8a054..a4ba376e66 100644 --- a/packages/core-plugin-api/src/translation/TranslationMessages.test.ts +++ b/packages/core-plugin-api/src/translation/TranslationMessages.test.ts @@ -23,7 +23,7 @@ const ref = createTranslationRef({ one: 'one', two: 'two', three: 'three', - } as const, + }, }); describe('createTranslationMessages', () => { diff --git a/packages/core-plugin-api/src/translation/TranslationRef.ts b/packages/core-plugin-api/src/translation/TranslationRef.ts index 9ebf39a423..345a9c3f65 100644 --- a/packages/core-plugin-api/src/translation/TranslationRef.ts +++ b/packages/core-plugin-api/src/translation/TranslationRef.ts @@ -108,7 +108,7 @@ class TranslationRefImpl< /** @alpha */ export function createTranslationRef< TId extends string, - TMessages extends { [key in string]: string }, + const TMessages extends { [key in string]: string }, TTranslations extends { [language in string]: () => Promise<{ default: { [key in keyof TMessages]: string | null }; diff --git a/plugins/adr/src/translations.ts b/plugins/adr/src/translations.ts index 5cef279e66..cc0995f597 100644 --- a/plugins/adr/src/translations.ts +++ b/plugins/adr/src/translations.ts @@ -22,5 +22,5 @@ export const adrTranslationRef = createTranslationRef({ content_header_title: 'Architecture Decision Records', failed_to_fetch: 'Failed to fetch ADRs', no_adrs: 'No ADRs found', - } as const, + }, }); diff --git a/plugins/user-settings/src/translation.ts b/plugins/user-settings/src/translation.ts index 79b817c828..42fd8311e2 100644 --- a/plugins/user-settings/src/translation.ts +++ b/plugins/user-settings/src/translation.ts @@ -30,5 +30,5 @@ export const userSettingsTranslationRef = createTranslationRef({ select_theme: 'Select {{theme}}', select_theme_auto: 'Select Auto Theme', select_lng: 'Select language {{language}}', - } as const, + }, });