var selector = document.getElementById('lang-select')

// add change listener
selector.addEventListener('change', function (event) {
  // Go to page in the locale specified
  var location = window.location
  var url = location.href.replace(/built\/([a-z]{2}-[A-Z]{2})/, 'built/' + selector.value)
  location.href = url
})
