forked from aralroca/next-translate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Details: --- *
- Loading branch information
Showing
13 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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 @@ | ||
{ | ||
"title": "next-translate knihovna", | ||
"second-page": "Druhá <0>stránka</0>", | ||
"loading": "Nahrávám...", | ||
"layout-title": "Titulek rozložení" | ||
} |
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,3 @@ | ||
{ | ||
"client-only": "Pouze client-side" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
module.exports = { | ||
locales: ['en', 'ca', 'es'], | ||
locales: ['en', 'ca', 'es', 'cs'], | ||
defaultLocale: 'en', | ||
pages: { | ||
'*': ['common'], | ||
'/[lang]': ['home'], | ||
'/[lang]/second-page': ['home'], | ||
'/[lang]/[slug]': ['home'], | ||
}, | ||
loadLocaleFrom: (locale, namespace) => { | ||
const i18nLocale = `./honza/${locale}/${namespace}.json` | ||
console.log('i18n.js > loadLocaleFrom() :::', { i18nLocale }) | ||
|
||
return import(i18nLocale) | ||
.then((m) => m.default) | ||
.catch((e) => console.error(e)) | ||
}, | ||
} |
16 changes: 16 additions & 0 deletions
16
examples/with-app-directory/src/app/[lang]/[slug]/page.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,16 @@ | ||
import Link from 'next/link' | ||
import useTranslation from 'next-translate/useTranslation' | ||
import Trans from 'next-translate/Trans' | ||
|
||
export default function Page() { | ||
const { t, lang } = useTranslation('common') | ||
return ( | ||
<> | ||
<h2>{t`title`}</h2> | ||
<Trans i18nKey="common:second-page" components={[<b />]} /> | ||
<div> | ||
<Link href={`/${lang}`}>⬅️</Link> | ||
</div> | ||
</> | ||
) | ||
} |
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
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