onLocaleMessagesLoaded
onLocaleMessagesLoaded is exported from the browser bundle and used when you load dist/client.js.
It ties locale events to the custom-element layer so DOM workflows can react to runtime lifecycle without importing the full module API.
Signature
ts
1function onLocaleMessagesLoaded(2 options?: IntlLocaleOptions3) // Browser entry helperEvent model and lifecycle
The helper powers the same locale events that <intl-locale> emits:
locale-loadwhen a locale file fetch completeslocale-changewhen active locale is readylocale-errorwhen fetch/parsing fails
html
1<intl-locale locale="en-US" src-dir="/locales"></intl-locale>2<script>3 document.body.addEventListener('locale-load', (event) => {4 console.log('loaded', event.detail.locale)5 })6</script>Use this in browser mode when you need global setup and want to keep logic in HTML.
For explicit JS subscriptions and snapshots, prefer subscribeIntl().
Native references: CustomEvent, Web Components
edit this doc