-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59c75c4
commit ad8787e
Showing
14 changed files
with
1,173 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// import LanguageDetector from 'i18next-browser-languagedetector' | ||
|
||
import { initReactI18next } from 'react-i18next' | ||
|
||
import i18n from 'i18next' | ||
import LanguageDetector from 'i18next-browser-languagedetector' | ||
|
||
// import resourcesToBackend from 'i18next-resources-to-backend' | ||
|
||
import { i18nextViewsInstance } from '@harnessio/ui/internationalization' | ||
|
||
// import common from './en/common.json' | ||
// import common_fr from './common-fr.json' | ||
|
||
// const resources = { | ||
// en: { common } | ||
// // fr: { common: common_fr }∏ | ||
// } | ||
|
||
console.log('i18n from views', i18nextViewsInstance) | ||
console.log('i18n from gitness', i18n) | ||
|
||
i18n | ||
.use(initReactI18next) | ||
.use(LanguageDetector) | ||
// .use( | ||
// resourcesToBackend((language: string, namespace: string) => { | ||
// return import(`./${language}/${namespace}.json`) | ||
// }) | ||
// ) | ||
.init({ | ||
resources: {}, | ||
fallbackLng: 'fr', | ||
debug: true, | ||
lng: 'fr', | ||
interpolation: { | ||
escapeValue: false | ||
} | ||
}) | ||
|
||
i18n.on('languageChanged', lng => { | ||
console.log('languageChanged here', lng) | ||
i18nextViewsInstance.i18nextViewsInstance.changeLanguage('fr') | ||
}) | ||
i18n.changeLanguage('fr') | ||
// i18nextViewsInstance.changeLanguage('fr') | ||
|
||
export default i18n |
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,15 @@ | ||
{ | ||
"navbar": { | ||
"pin": "Pin", | ||
"remove": "Remove", | ||
"reorder": "Reorder", | ||
"unpin": "Unpin", | ||
"repositories": "Repositories", | ||
"pipelines": "Pipelines", | ||
"executions": "Executions", | ||
"databases": "Databases", | ||
"artifacts": "Artifacts", | ||
"infrastructure": "Infrastructure", | ||
"feature-flags": "Feature Flags" | ||
} | ||
} |
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,15 @@ | ||
{ | ||
"navbar": { | ||
"pin": "Épingler", | ||
"remove": "Supprimer", | ||
"reorder": "Réorganiser", | ||
"unpin": "Détacher", | ||
"repositories": "Dépôts", | ||
"pipelines": "Pipelines", | ||
"executions": "Exécutions", | ||
"databases": "Bases de données", | ||
"artifacts": "Artifacts", | ||
"infrastructure": "Infrastructure", | ||
"feature-flags": "Drapeaux de fonctionnalité" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { initReactI18next } from 'react-i18next' | ||
|
||
import { createInstance } from 'i18next' | ||
|
||
import en_navbar from '../components/i18n/locales/en.json' | ||
import fr_navbar from '../components/i18n/locales/fr.json' | ||
|
||
// import fr from './fr.json' | ||
|
||
// const resources = { | ||
// en: { translation: en }, | ||
// fr: { translation: fr } | ||
// } | ||
const resources = { | ||
en: { translation: en_navbar }, | ||
fr: { translation: fr_navbar } | ||
} | ||
export const i18nextViewsInstance = createInstance({ | ||
resources, | ||
fallbackLng: 'en', | ||
// lng: 'fr', | ||
interpolation: { | ||
escapeValue: false | ||
} | ||
}) | ||
i18nextViewsInstance.use(initReactI18next) | ||
i18nextViewsInstance.init() |
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 @@ | ||
export * as i18nextViewsInstance from './i18n' |
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
Oops, something went wrong.