i18query
v1.0.6
Published
Reserved name
Readme
// FOLDER STRUCTURE locale en auth.json common.json ba auth.json common.json
// REACT const [lang, setLang] = useState('en');
useEffect(() => { getLangStrings() }, [lang])
const getLangStrings = async () => { setisLoading(true)
const [authData, commonData] = await Promise.all([
fetch(../public/locales/${lang}/auth.json).then(res => res.json()),
fetch(../public/locales/${lang}/common.json).then(res => res.json())
]);
const strings = {...authData, ...commonData} // save to ls i18query.init([strings])
setisLoading(false) }
