static/src/core/router.js
/**
 * Normalize the given language string, e.g. "DE" => "de", or "En-gB" => "en-GB".
 *
 * @param {string} lang to normalize
 * @return {string}
 */
Normalize the given language string, e.g.
Normalize the given language string e . g .
function normalizeLang(lang) {
  const parts = (lang || '').split('-');
  parts[0] = parts[0].toLowerCase();
  if (parts.length >= 2) {
    parts[1] = parts[1].toUpperCase();
  }
  return parts.join('-');
}
function normalizeLang ( lang ) { const parts = ( lang || '' ) . split ( '-' ) ; parts [ 0 ] = parts [ 0 ] . toLowerCase ( ) ; if ( parts . length >= 2 ) { parts [ 1 ] = parts [ 1 ] . toUpperCase ( ) ; } return parts . join ( '-' ) ; }
Normalize the given language string, e.g.
Normalize the given language string e . g .