function processLangZoneTerms(initialLoad, language, countryCode) {
  var langSegments = language.split('-');
  if (initialLoad && navigateToLanguageAndCountryCode(language, countryCode)) {
    document.body.hidden = false;
    return true;
  }

  var matchByLang = '/intl/' + language + '_';
  var matchByLangShort = null;
  if (langSegments.length == 2) {
    matchByLangShort = '/intl/' + langSegments[0] + '_';
  }

  var matchByZone = '_' + countryCode + '/about/play-terms.html';
  var matchByDefault = '/intl/en/about/play-terms.html';

  // We are allowed to display terms by default only in language that matches
  // current UI language. In other cases we have to switch to default version.
  var langMatch = false;
  var defaultExist = false;

  var doc = document;
  var selectLangZoneTerms =
      doc.getElementById('play-footer').getElementsByTagName('select')[0];
  for (var i = selectLangZoneTerms.options.length - 1; i >= 0; --i) {
    var option = selectLangZoneTerms.options[i];
    if (selectLangZoneTerms.selectedIndex == i) {
      langMatch = option.value.startsWith(matchByLang) ||
          (matchByLangShort && option.value.startsWith(matchByLangShort));
      continue;
    }
    if (option.value == matchByDefault) {
      defaultExist = true;
      continue;
    }

    option.hidden = !option.value.startsWith(matchByLang) &&
        !option.value.endsWith(matchByZone) &&
        !(matchByLangShort && option.value.startsWith(matchByLangShort)) &&
        option.text != 'English';
  }

  if (initialLoad && !langMatch && defaultExist) {
    window.location.href = matchByDefault;
  } else {
    // Show content once we reached target url.
    document.body.hidden = false;
  }
  return true;
}
/**
 * Processes select tag that contains list of available terms for different
 * languages and zones. In case of initial load, tries to find terms that match
 * exactly current language and country code and automatically redirects the
 * view in case such terms are found. Leaves terms in select tag that only match
 * current language or country code or default English variant or currently
 * selected.
 *
 * @return {boolean} True.
 */
Processes select tag that contains list of available terms for different
languages and zones. In case of initial load, tries to find terms that match
exactly current language and country code and automatically redirects the
view in case such terms are found. Leaves terms in select tag that only match
current language or country code or default English variant or currently
selected.

@return {boolean} True.
Processes select tag that contains list of available terms for different languages and zones . In case of initial load tries to find terms that match exactly current language and country code and automatically redirects the view in case such terms are found . Leaves terms in select tag that only match current language or country code or default English variant or currently selected . @return { boolean } True .
function processLangZoneTerms(initialLoad, language, countryCode) {
  var langSegments = language.split('-');
  if (initialLoad && navigateToLanguageAndCountryCode(language, countryCode)) {
    document.body.hidden = false;
    return true;
  }
  var matchByLang = '/intl/' + language + '_';
  var matchByLangShort = null;
  if (langSegments.length == 2) {
    matchByLangShort = '/intl/' + langSegments[0] + '_';
  }
  var matchByZone = '_' + countryCode + '/about/play-terms.html';
  var matchByDefault = '/intl/en/about/play-terms.html';
  var langMatch = false;
  var defaultExist = false;
  var doc = document;
  var selectLangZoneTerms =
      doc.getElementById('play-footer').getElementsByTagName('select')[0];
  for (var i = selectLangZoneTerms.options.length - 1; i >= 0; --i) {
    var option = selectLangZoneTerms.options[i];
    if (selectLangZoneTerms.selectedIndex == i) {
      langMatch = option.value.startsWith(matchByLang) ||
          (matchByLangShort && option.value.startsWith(matchByLangShort));
      continue;
    }
    if (option.value == matchByDefault) {
      defaultExist = true;
      continue;
    }
    option.hidden = !option.value.startsWith(matchByLang) &&
        !option.value.endsWith(matchByZone) &&
        !(matchByLangShort && option.value.startsWith(matchByLangShort)) &&
        option.text != 'English';
  }
  if (initialLoad && !langMatch && defaultExist) {
    window.location.href = matchByDefault;
  } else {
    document.body.hidden = false;
  }
  return true;
}
function processLangZoneTerms ( initialLoad , language , countryCode ) { var langSegments = language . split ( '-' ) ; if ( initialLoad && navigateToLanguageAndCountryCode ( language , countryCode ) ) { document . body . hidden = false ; return true ; } var matchByLang = '/intl/' + language + '_' ; var matchByLangShort = null ; if ( langSegments . length == 2 ) { matchByLangShort = '/intl/' + langSegments [ 0 ] + '_' ; } var matchByZone = '_' + countryCode + '/about/play-terms.html' ; var matchByDefault = '/intl/en/about/play-terms.html' ; var langMatch = false ; var defaultExist = false ; var doc = document ; var selectLangZoneTerms = doc . getElementById ( 'play-footer' ) . getElementsByTagName ( 'select' ) [ 0 ] ; for ( var i = selectLangZoneTerms . options . length - 1 ; i >= 0 ; -- i ) { var option = selectLangZoneTerms . options [ i ] ; if ( selectLangZoneTerms . selectedIndex == i ) { langMatch = option . value . startsWith ( matchByLang ) || ( matchByLangShort && option . value . startsWith ( matchByLangShort ) ) ; continue ; } if ( option . value == matchByDefault ) { defaultExist = true ; continue ; } option . hidden = ! option . value . startsWith ( matchByLang ) && ! option . value . endsWith ( matchByZone ) && ! ( matchByLangShort && option . value . startsWith ( matchByLangShort ) ) && option . text != 'English' ; } if ( initialLoad && ! langMatch && defaultExist ) { window . location . href = matchByDefault ; } else { document . body . hidden = false ; } return true ; }
Processes select tag that contains list of available terms for different
 languages and zones.
Processes select tag that contains list of available terms for different languages and zones .
// We are allowed to display terms by default only in language that matches // current UI language. In other cases we have to switch to default version. // Show content once we reached target url.