docs-sources/javascripts/app/_lang.js
function pushURL(language) {
    if (!history) { return; }
    var hash = window.location.hash;
    if (hash) {
      hash = hash.replace(/^#+/, '');
    }
    history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash);

    // save language as next default
    localStorage.setItem("language", language);
  }
function pushURL(language) {
    if (!history) { return; }
    var hash = window.location.hash;
    if (hash) {
      hash = hash.replace(/^#+/, '');
    }
    history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash);

    // save language as next default
    localStorage.setItem("language", language);
  }
function pushURL ( language ) { if ( ! history ) { return ; } var hash = window . location . hash ; if ( hash ) { hash = hash . replace ( / ^#+ / , '' ) ; } history . pushState ( { } , '' , '?' + generateNewQueryString ( language ) + '#' + hash ) ; // save language as next default localStorage . setItem ( "language" , language ) ; }
if a button is clicked, add the state to the history
if a button is clicked add the state to the history