2018-03-29 12:47:52 +00:00
|
|
|
import i18next from 'i18next'
|
2019-02-08 11:45:14 +00:00
|
|
|
import { initReactI18next } from 'react-i18next'
|
2019-10-12 18:23:54 +00:00
|
|
|
import unitsTranslations from './locales/units.yaml'
|
2018-06-18 10:12:08 +00:00
|
|
|
|
2019-11-10 15:57:44 +00:00
|
|
|
export type AvailableLangs = 'fr' | 'en'
|
|
|
|
|
2019-10-12 16:45:55 +00:00
|
|
|
i18next
|
|
|
|
.use(initReactI18next)
|
|
|
|
.init({
|
2018-03-29 12:47:52 +00:00
|
|
|
resources: {
|
2019-10-12 18:23:54 +00:00
|
|
|
fr: { units: unitsTranslations.fr },
|
2020-04-25 13:27:34 +00:00
|
|
|
en: { units: unitsTranslations.en }
|
2018-04-04 10:10:34 +00:00
|
|
|
}
|
2019-10-12 16:45:55 +00:00
|
|
|
})
|
|
|
|
.catch(err => console?.error('Error from i18n load', err))
|
2018-03-29 12:47:52 +00:00
|
|
|
|
2018-11-09 11:36:29 +00:00
|
|
|
export default i18next
|