Skip to main content

Register your Translations

The power of React Translation is into avoiding gigantic translations files.
To get to this point, we implemented a registration system that merges translations to a single source of truth

Register translations

Registering translations is easy:

import { registerTranslations } from '@psyycker/react-translation';

//Executed outside of the component
registerTranslations({
'en-US': {
yes: 'Yes'
},
'fr-FR': {
yes: 'Oui'
}
});

And that's it! Your translation is now ready to use.

The locales specified in the object need to fit with your choice of locales.