Skip to content

Commit

Permalink
fix: only initialized i18next if not already initialized [DHIS2-14132]
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Nov 28, 2022
1 parent c75e6dc commit 5a95d0d
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import i18next from 'i18next'

i18next.init({
resources: undefined,
if (!i18next.isInitialized) {
i18next.init({
resources: undefined,

lng: 'en',
fallbackLng: 'en',
lng: 'en',
fallbackLng: 'en',

debug: false,
ns: ['translation'],
defaultNS: 'translation',
fallbackNS: false,
nsSeparator: false,
debug: false,
ns: ['translation'],
defaultNS: 'translation',
fallbackNS: false,
nsSeparator: false,

returnEmptyString: false,
returnObjects: false,
returnEmptyString: false,
returnObjects: false,

keySeparator: false,
react: {
wait: true,
},
})
keySeparator: false,
react: {
wait: true,
},
})
}

export default i18next

0 comments on commit 5a95d0d

Please sign in to comment.