client/lib/user-settings/index.js
function hasLanguageChanged( languageSettingValue, settings = {} ) {
	if ( ! languageSettingValue ) {
		return false;
	}
	// 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
	);
}
function hasLanguageChanged( languageSettingValue, settings = {} ) {
	if ( ! languageSettingValue ) {
		return false;
	}
	// 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
	);
}
function hasLanguageChanged ( languageSettingValue , settings = { } ) { if ( ! languageSettingValue ) { return false ; } // 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 ) ; }
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

@param  {String}  languageSettingValue the newly-set language slug string.
@param  {Object}  settings user settings object.
@return {Boolean} if the language setting has been changed.
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