Skip to content

Instantly share code, notes, and snippets.

@niw
Created June 29, 2011 22:04
Show Gist options
  • Save niw/1055127 to your computer and use it in GitHub Desktop.
Save niw/1055127 to your computer and use it in GitHub Desktop.
A bookmarklet to switch languages of search results (lr parameter).
javascript:(function(){var%20ls=[%22ja%22,%22en%22],re=/\blr=lang_([a-zA-Z][a-zA-Z])\b/,w=window,h=w.location.href,m=h.match(re);w.location=m?h.replace(re,%22lr=lang_%22+(ls[ls.indexOf(m[1])+1]||ls[0])):h+(h.match(/[?#]/)?%22&%22:%22?%22)+%22lr=lang_%22+ls[0];})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment