src/sap.ui.core/src/sap/base/i18n/ResourceBundle.js
function nextFallbackLocale(sLocale) {

		// there is no fallback for the 'raw' locale or for null/undefined
		if ( !sLocale ) {
			return null;
		}

		// special (legacy) handling for zh_HK: try zh_TW (for Traditional Chinese) first before falling back to 'zh'
		if ( sLocale === "zh_HK" ) {
			return "zh_TW";
		}

		// if there are multiple segments (separated by underscores), remove the last one
		var p = sLocale.lastIndexOf('_');
		if ( p >= 0 ) {
			return sLocale.slice(0,p);
		}
		// invariant: only a single segment, must be a language

		// for any language but 'en', fallback to 'en' first before falling back to the 'raw' language (empty string)
		return sLocale !== 'en' ? 'en' : '';
	}
function nextFallbackLocale(sLocale) {

		// there is no fallback for the 'raw' locale or for null/undefined
		if ( !sLocale ) {
			return null;
		}

		// special (legacy) handling for zh_HK: try zh_TW (for Traditional Chinese) first before falling back to 'zh'
		if ( sLocale === "zh_HK" ) {
			return "zh_TW";
		}

		// if there are multiple segments (separated by underscores), remove the last one
		var p = sLocale.lastIndexOf('_');
		if ( p >= 0 ) {
			return sLocale.slice(0,p);
		}
		// invariant: only a single segment, must be a language

		// for any language but 'en', fallback to 'en' first before falling back to the 'raw' language (empty string)
		return sLocale !== 'en' ? 'en' : '';
	}
function nextFallbackLocale ( sLocale ) { // there is no fallback for the 'raw' locale or for null/undefined if ( ! sLocale ) { return null ; } // special (legacy) handling for zh_HK: try zh_TW (for Traditional Chinese) first before falling back to 'zh' if ( sLocale === "zh_HK" ) { return "zh_TW" ; } // if there are multiple segments (separated by underscores), remove the last one var p = sLocale . lastIndexOf ( '_' ) ; if ( p >= 0 ) { return sLocale . slice ( 0 , p ) ; } // invariant: only a single segment, must be a language // for any language but 'en', fallback to 'en' first before falling back to the 'raw' language (empty string) return sLocale !== 'en' ? 'en' : '' ; }
Calculate the next fallback locale for the given locale.

Note: always keep this in sync with the fallback mechanism in Java, ABAP (MIME & BSP)
resource handler (Java: Peter M., MIME: Sebastian A., BSP: Silke A.)
@param {string} sLocale Locale string in Java format (underscores) or null
@returns {string|null} Next fallback Locale or null if there is no more fallback
@private
Calculate the next fallback locale for the given locale .