Description
The forms app attempts to pick the right language but it's limited because, a) it doesn't know anything about the languages configured in the xform, and b) it doesn't know when the user manually picks a language using the components language selector. This means the language of the app and component may get out of sync, particularly for first load, when the user hasn't set the locale in local storage yet.
Extend the API with an event that fires when the locale is set, both when the web-forms i18n code updates it, and when the user picks a language from the dropdown. Update the forms app to listen to this event and update its locale.
Description
The forms app attempts to pick the right language but it's limited because, a) it doesn't know anything about the languages configured in the xform, and b) it doesn't know when the user manually picks a language using the components language selector. This means the language of the app and component may get out of sync, particularly for first load, when the user hasn't set the locale in local storage yet.
Extend the API with an event that fires when the locale is set, both when the web-forms i18n code updates it, and when the user picks a language from the dropdown. Update the forms app to listen to this event and update its locale.