fix type
parent
ed1b999fb8
commit
e4e9e6327d
|
@ -8,7 +8,9 @@ import i18n from '../../locales/i18n'
|
|||
|
||||
export type Rules = Record<DottedName, Rule>
|
||||
|
||||
const unitsTranslations = Object.entries(i18n.getResourceBundle('fr', 'units'))
|
||||
const unitsTranslations = Object.entries(
|
||||
i18n.getResourceBundle('fr', 'units') as Record<string, string>
|
||||
)
|
||||
const engineOptions = {
|
||||
getUnitKey(unit: string): string {
|
||||
const key = unitsTranslations
|
||||
|
|
|
@ -4,17 +4,23 @@ import unitsTranslations from './units.yaml'
|
|||
|
||||
export type AvailableLangs = 'fr' | 'en'
|
||||
|
||||
interface Units {
|
||||
fr: Record<string, string>
|
||||
en: Record<string, string>
|
||||
}
|
||||
|
||||
i18next
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources: {
|
||||
fr: { units: unitsTranslations.fr },
|
||||
en: { units: unitsTranslations.en },
|
||||
fr: { units: (unitsTranslations as Units).fr },
|
||||
en: { units: (unitsTranslations as Units).en },
|
||||
},
|
||||
react: {
|
||||
useSuspense: false,
|
||||
},
|
||||
})
|
||||
// eslint-disable-next-line no-console
|
||||
.catch((err) => console?.error('Error from i18n load', err))
|
||||
|
||||
export default i18next
|
||||
|
|
|
@ -191,7 +191,7 @@ function Home() {
|
|||
|
||||
const setEntreprise = useSetEntreprise()
|
||||
|
||||
const updateEntrprise =
|
||||
const updateEntreprise =
|
||||
overwrite &&
|
||||
!entreprisePending &&
|
||||
!entrepriseNotFound &&
|
||||
|
@ -199,11 +199,11 @@ function Home() {
|
|||
entreprise.siren !== engineSiren
|
||||
|
||||
useEffect(() => {
|
||||
if (updateEntrprise) {
|
||||
if (updateEntreprise) {
|
||||
setEntreprise(entreprise)
|
||||
setOverwrite(false)
|
||||
}
|
||||
}, [entreprise, setEntreprise, updateEntrprise])
|
||||
}, [entreprise, setEntreprise, updateEntreprise])
|
||||
|
||||
if (
|
||||
gérerPath &&
|
||||
|
|
Loading…
Reference in New Issue