pure
    Preparing search index...

    Function addLocaleSubscriber

    • 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.

      Parameters

      • fn: (locale: string) => void
      • OptionalnotifyImmediately: boolean

      Returns () => void