Heads up!
use clone() with loadLocaleJSON to pass the JSON data in, or it will modify that variable. and next time you try to switch back to language you had previously, it will be overwritten with new one.
Examples:
const locales: Record<string, any> = {
en: require('~/i18n/en.default.json'),
pt: require('~/i18n/pt.json')
}
// User chose "EN"
loadLocaleJSON(clone(locales.en), {})
// User chose "PT"
loadLocaleJSON(clone(locales.pt || {}), clone(locales.en))