{t('description')}
-- {t.rich('rich', {important: (chunks) => {chunks}})} -
+{t.rich('globalDefaults')}
{/* @ts-expect-error Purposefully trigger an error */}{t('missing')}
diff --git a/examples/example-app-router-playground/src/components/AsyncComponent.tsx b/examples/example-app-router-playground/src/components/AsyncComponent.tsx index e7cd0efe4..d3f985e35 100644 --- a/examples/example-app-router-playground/src/components/AsyncComponent.tsx +++ b/examples/example-app-router-playground/src/components/AsyncComponent.tsx @@ -7,7 +7,11 @@ export default async function AsyncComponent() {
{t('basic')}
{t.rich('rich', {important: (chunks) => {chunks}})}
-{t.markup('markup', {b: (chunks) => `${chunks}`})}
++ {t.markup('markup', { + important: (chunks) => `${chunks}` + })} +
{String(t.has('basic'))}
+ {children({ + b: (chunks: ReactNode) => {chunks}, + i: (chunks: ReactNode) => {chunks} + })} +
+ ); +} diff --git a/examples/example-app-router-playground/src/i18n/request.tsx b/examples/example-app-router-playground/src/i18n/request.tsx index 79af138bc..d132c19e2 100644 --- a/examples/example-app-router-playground/src/i18n/request.tsx +++ b/examples/example-app-router-playground/src/i18n/request.tsx @@ -45,10 +45,6 @@ export default getRequestConfig(async ({requestLocale}) => { now: now ? new Date(now) : undefined, timeZone, messages, - defaultTranslationValues: { - globalString: 'Global string', - highlight: (chunks) => {chunks} - }, formats, onError(error) { if ( diff --git a/examples/example-app-router-playground/tests/main.spec.ts b/examples/example-app-router-playground/tests/main.spec.ts index 89d6df713..f364e7a22 100644 --- a/examples/example-app-router-playground/tests/main.spec.ts +++ b/examples/example-app-router-playground/tests/main.spec.ts @@ -215,21 +215,15 @@ it('can use next-intl on the client side', async ({page}) => { it('can use rich text', async ({page}) => { await page.goto('/en'); const element = page.getByTestId('RichText'); - expect(await element.innerHTML()).toBe('This is a rich text.'); -}); - -it('can use raw text', async ({page}) => { - await page.goto('/en'); - const element = page.getByTestId('RawText'); expect(await element.innerHTML()).toBe( - 'This is a