Add a subscriber to be notified when the locale changes.
Returns a function to remove the subscriber
If notifyImmediately is true, the subscriber will be called immediately with the current locale.
Note that it's not guaranteed that the new locale is ready when the subscriber is notified.
Any async operations such as loading the language files should be done in the
onBeforeChange hook if the subscribers need to wait for it.
Add a subscriber to be notified when the locale changes. Returns a function to remove the subscriber
If
notifyImmediatelyistrue, the subscriber will be called immediately with the current locale. Note that it's not guaranteed that the new locale is ready when the subscriber is notified. Any async operations such as loading the language files should be done in theonBeforeChangehook if the subscribers need to wait for it.