-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update
next-intl
to support latest release (#1048)
* feat: Update `next-intl` to support latest release candidate (`getTranslations` & `t.markup`) * Update examples/by-frameworks/next-intl/package.json Co-authored-by: Robin Louarn <[email protected]> * Support object form of `getTranslations` (h/t @ixartz) --------- Co-authored-by: Robin Louarn <[email protected]>
- Loading branch information
Showing
8 changed files
with
63 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
examples/by-frameworks/next-intl/src/app/[locale]/GetTranslationsTest1.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { getTranslations } from 'next-intl/server' | ||
|
||
export default async function GetTranslationsTest1() { | ||
const t = await getTranslations() | ||
return <p>{t('IndexPage.title')}</p> | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/by-frameworks/next-intl/src/app/[locale]/GetTranslationsTest2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { getTranslations } from 'next-intl/server' | ||
|
||
export default async function GetTranslationsTest2() { | ||
const t = await getTranslations('IndexPage') | ||
return <p>{t('title')}</p> | ||
} |
9 changes: 9 additions & 0 deletions
9
examples/by-frameworks/next-intl/src/app/[locale]/GetTranslationsTest3.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { getTranslations } from 'next-intl/server' | ||
|
||
export default async function GetTranslationsTest3() { | ||
const t = await getTranslations({ | ||
locale: 'en', | ||
namespace: 'IndexPage', | ||
}) | ||
return <p>{t('title')}</p> | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/by-frameworks/next-intl/src/app/[locale]/UseTranslationsTest1.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { useTranslations } from 'next-intl' | ||
|
||
export default function UseTranslationsTest1() { | ||
const t = useTranslations('Test') | ||
return <p>{t('title')}</p> | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/by-frameworks/next-intl/src/app/[locale]/UseTranslationsTest2.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { useTranslations } from 'next-intl' | ||
|
||
export default function UseTranslationsTest2() { | ||
const t = useTranslations() | ||
return <p>{t('Test.title')}</p> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters