Skip to content

Instantly share code, notes, and snippets.

@tnodet
Created June 10, 2018 11:48
Show Gist options
  • Select an option

  • Save tnodet/8ea645c5224d33f4ee893d87ed4bbb3f to your computer and use it in GitHub Desktop.

Select an option

Save tnodet/8ea645c5224d33f4ee893d87ed4bbb3f to your computer and use it in GitHub Desktop.
[browser extension] change google search language with a simple parameter in the search bar

Problem: when doing a search on Google, the results will be in the language set for your Google account, or if you are not logged in, for this specific browser. See: https://www.google.com/preferences#languages

There is not query parameter you can use with Google to return results in a particular language, just once. Solutions include:

A bit tedious, you can use custom search engines in your browser (https://webapps.stackexchange.com/questions/27918/how-can-i-make-google-do-one-shot-searches-in-a-specific-language-only) On Google Chrome, one way to do that is to add a search engine with the following URL: https://www.google.fr/search?q=%s&hl=xx, and invoke it using its keyword. On Firefox, it is sadly more complicated to create a custom search engine:

Problems:

  • Setting up for several languages is tedious
  • What about when searching results in multiple languages?

A simpler solution would be an browser extension that would allow the use of a parameter in the search box to set the language of the results for this query. Example:

diderot --lang=fr # returns results in french
shakespeare --lang=en,de  # returns results in english and german

Is this only possible in browsers (at least in sufficiently sane way)? Further investigation is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment