This library was generated with Nx.
This library is intent to be used as a translator of predefined json file that can be created with react-translator-gui website
{"translate_key":{"fr":"Je suis une traduction","au":"I'm a translation"}}
import locales from './locales.json'
const ExampleComponent = () => {
const translateKey = useTranslator("translate_key");
return (
<div>{translateKey}<div>
)
}
const ExampleComponent2 = () => {
const translated = useTranslator();
return (
<div>{translated["translate_key"]}<div>
)
}
const App = () => {
return (
<ReactTranslatorContextProvider locales={locales}>
{/**Your components*/}
</ReactTranslatorContextProvider>
);
}