nl_tokens: Checks if an incoming change to settings . language is a change to the existing settings Currently the assumption is that if a settings . locale_variant slug exists then that is the current language
pl_tokens: function hasLanguageChanged ( languageSettingValue , settings = { } ) { if ( ! languageSettingValue ) { return <mask> ; } // if there is a saved variant we know that the user is changing back to the root language === setting hasn't changed // but if settings.locale_variant is not empty then we assume the user is trying to switch back to the root return ( ( languageSettingValue === settings . language && isEmpty ( settings . locale_variant ) ) || //if the incoming language code is the variant itself === setting hasn't changed languageSettingValue === settings . locale_variant ) ; }