Detect when the locale returned by the root route loader changes and call
i18n.changeLanguage with the new locale.
This will ensure translations are loaded automatically.
Parameters
locale: string
Returns void
Deprecated
Pass the locale value from your root loader data to i18n.changeLanguage(locale).
For example: i18n.changeLanguage(loaderData.locale).
Detect when the locale returned by the root route loader changes and call
i18n.changeLanguagewith the new locale. This will ensure translations are loaded automatically.