Hello, first of all, awesome library!, yet i think it lacks more examples, specificaly using the api and connecting with React.
Im trying to add a functionalitiy which would allow the users to change language, without the need to refresh the page, currently im doing it this way:
My locale.js file
import LocalizedStrings from 'react-localization';
export default new LocalizedStrings({
en: {
navbarItem1: "EN",
},
ch: {
navbarItem1: "CH",
}
});
So basically, the first time they join, the page will be translated to the native language, yet if they wish to change language, i have to store said change to the local storage, refresh the page, and grab the language from the local storage instead of the native one.
Is there any way to link these changes to React state, and have it change live, without the need to force a page refresh?
If so, can i have a quick example please?
Hello, first of all, awesome library!, yet i think it lacks more examples, specificaly using the api and connecting with React.
Im trying to add a functionalitiy which would allow the users to change language, without the need to refresh the page, currently im doing it this way:
My locale.js file
My App.js file
So basically, the first time they join, the page will be translated to the native language, yet if they wish to change language, i have to store said change to the local storage, refresh the page, and grab the language from the local storage instead of the native one.
Is there any way to link these changes to React state, and have it change live, without the need to force a page refresh? If so, can i have a quick example please?
Best regards!