normalizeLocale = locale => {
    let m;
    if (!locale) {
      return _AssetParameters.DEFAULT_LOCALE;
    }
    if (typeof locale === "string" && (m = localeRegEX.exec(locale.replace(/_/g, "-")))) {
      /* eslint-disable-line */
      let language = m[1].toLowerCase();
      let region = m[3] ? m[3].toUpperCase() : undefined;
      const script = m[2] ? m[2].toLowerCase() : undefined;
      const variants = m[4] ? m[4].slice(1) : undefined;
      const isPrivate = m[6];
      language = M_ISO639_NEW_TO_OLD[language] || language;
      // recognize and convert special SAP supportability locales (overwrites m[]!)
      if (isPrivate && (m = SAPSupportabilityLocales.exec(isPrivate)) /* eslint-disable-line */ || variants && (m = SAPSupportabilityLocales.exec(variants))) {
        /* eslint-disable-line */
        return `en_US_${m[1].toLowerCase()}`; // for now enforce en_US (agreed with SAP SLS)
      }
      // Chinese: when no region but a script is specified, use default region for each script
      if (language === "zh" && !region) {
        if (script === "hans") {
          region = "CN";
        } else if (script === "hant") {
          region = "TW";
        }
      }
      return language + (region ? "_" + region + (variants ? "_" + variants.replace("-", "_") : "") : ""); /* eslint-disable-line */
    }

    return _AssetParameters.DEFAULT_LOCALE;
  }
Normalizes the given locale in BCP-47 syntax.
@param {string} locale locale to normalize
@returns {string} Normalized locale, "undefined" if the locale can't be normalized or the default locale, if no locale provided.