-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update with react 18next to latest (#5017)
* update with-react-i18next supporting new _app.js * update readme to not encourage cloning of repo
- Loading branch information
1 parent
bb13e94
commit e11d08a
Showing
11 changed files
with
105 additions
and
54 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
{ | ||
"welcome": "Willkommen zu next.js", | ||
"sample_test": "test words for de", | ||
"sample_button": "fire in the wind for de", | ||
"link": { | ||
"gotoPage2": "Zur Seite 2" | ||
"gotoPage2": "Zur Seite 2", | ||
"gotoPage3": "Zur Seite 3 (no hoc)" | ||
} | ||
} |
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,6 +1,9 @@ | ||
{ | ||
"welcome": "welcome to next.js", | ||
"sample_test": "test words for en", | ||
"sample_button": "fire in the wind for en", | ||
"link": { | ||
"gotoPage2": "Go to page 2" | ||
"gotoPage2": "Go to page 2", | ||
"gotoPage3": "Go to page 3 (no hoc)" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import App, { Container } from 'next/app' | ||
import { I18n as I18nR } from 'react-i18next' | ||
import i18n from '../i18n' | ||
|
||
export default class MyApp extends App { | ||
render () { | ||
const { Component, pageProps } = this.props | ||
|
||
return ( | ||
<Container> | ||
<I18nR ns='common' i18n={(pageProps && pageProps.i18n) || i18n} wait> | ||
{ | ||
(t) => ( | ||
<div> | ||
<h1>{t('common:integrates_react-i18next')}</h1> | ||
<Component {...pageProps} /> | ||
</div> | ||
) | ||
} | ||
</I18nR> | ||
</Container> | ||
) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// a page not using i18next - no hoc - not t function | ||
import React from 'react' | ||
import Link from 'next/link' | ||
|
||
export default () => { | ||
return ( | ||
<div> | ||
<h1>Hello Page 3</h1> | ||
<Link href='/'> | ||
<a>back</a> | ||
</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