diff --git a/examples/with-react-i18next/components/LanguageSwitch.js b/examples/with-react-i18next/components/LanguageSwitch.js new file mode 100644 index 00000000..af79e1cf --- /dev/null +++ b/examples/with-react-i18next/components/LanguageSwitch.js @@ -0,0 +1,22 @@ +import React from 'react' +import Link from 'next/link' +import { withRouter } from 'next/router' + +import i18n from '../i18n' + +const LanguageSwitch = ({ router }) => ( + +) + +export default withRouter(LanguageSwitch) diff --git a/examples/with-react-i18next/package.json b/examples/with-react-i18next/package.json index 541e23af..1fad62f6 100644 --- a/examples/with-react-i18next/package.json +++ b/examples/with-react-i18next/package.json @@ -12,14 +12,14 @@ "license": "MIT", "dependencies": { "express": "4.16.3", - "i18next": "11.3.6", - "i18next-browser-languagedetector": "2.2.0", - "i18next-express-middleware": "1.2.0", - "i18next-node-fs-backend": "1.2.1", + "i18next": "11.9.0", + "i18next-browser-languagedetector": "2.2.3", + "i18next-express-middleware": "1.4.0", + "i18next-node-fs-backend": "2.1.0", "i18next-xhr-backend": "1.5.1", - "next": "^6.1.1", - "react": "^16.4.1", - "react-dom": "^16.4.1", - "react-i18next": "7.8.1" + "next": "latest", + "react": "^16.5.2", + "react-dom": "^16.5.2", + "react-i18next": "7.13.0" } } diff --git a/examples/with-react-i18next/pages/_app.js b/examples/with-react-i18next/pages/_app.js index 0ce7ed75..87d09b5c 100644 --- a/examples/with-react-i18next/pages/_app.js +++ b/examples/with-react-i18next/pages/_app.js @@ -2,6 +2,7 @@ import React from 'react' import App, { Container } from 'next/app' import { I18n as I18nR, I18nextProvider } from 'react-i18next' import initialI18nInstance from '../i18n' +import LanguageSwitch from '../components/LanguageSwitch' export default class MyApp extends App { render () { @@ -19,6 +20,7 @@ export default class MyApp extends App { {t =>

{t('common:integrates_react-i18next')}

}
+