Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat(i18n): reorganize public translation resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ocBruno committed Jan 7, 2020
1 parent 83923b2 commit 761deda
Show file tree
Hide file tree
Showing 37 changed files with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/i18n.js
Expand Up @@ -3,8 +3,9 @@ import Backend from 'i18next-xhr-backend'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'

import * as en from './example.json';
i18n
// load translation using xhr -> see /public/app-sections/languages
// load translation using xhr -> see /public/languages
// learn more: https://github.com/i18next/i18next-xhr-backend
.use(Backend)
// detect user language
Expand All @@ -15,6 +16,24 @@ i18n
// init i18next
// for all options read: https://www.i18next.com/overview/configuration-options
.init({
// we init with resources
resources: {
en: {
translations: {
"To get started, edit <1>src/App.js</1> and save to reload.":
"To get started, edit <1>src/App.js</1> and save to reload.",
"Welcome to React": "Welcome to React and react-i18next",
welcome: "Hello <br/> <strong>World</strong>"
}
},
de: {
translations: {
"To get started, edit <1>src/App.js</1> and save to reload.":
"Starte in dem du, <1>src/App.js</1> editierst und speicherst.",
"Welcome to React": "Willkommen bei React und react-i18next"
}
}
},
fallbackLng: 'en',
debug: true,

Expand Down

0 comments on commit 761deda

Please sign in to comment.