Search Gmail by Language
Posted by Gina Trapani at 1:00 AM on November 17, 2007

An undocumented Gmail search operator, language: (or simply lang:), finds messages by the language they're written in. Give it a try in your inbox: lang:Portuguese and lang:Arabic both turn up several messages in the Lifehacker tips box. Sadly -lang:English doesn't seem to work, which would be perfect to create a filter for all messages not in English; but you can create filters to snag messages in particular languages you don't speak, for instance.
Tags: email | gmail | google school | language | languages | search operators | top

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
Protector one
Posted 12:34 PM 16/11/07
I searched lang:c++... I got no results. How sad!
Protector one
Irian
Posted 12:20 PM 16/11/07
Yep, -lang:English does not seem to work. -lang:Spanish does not work either, so I'm guessing -lang:any is still being worked on
lang:Spanish does seem to be doing a good job detecting all the mail I send and receive in Spanish.
Irian
Cidinho
Posted 12:13 PM 16/11/07
Just used -lang:english and all my English mail appeared... I don't have much other-language-mails, though...
Cidinho
Whoopsi
Posted 12:03 PM 16/11/07
none of them seem to work properly for me. If I put it lang:english I still get a bunch of chinese/japanese/dingbats.... and if I put -lang:english it randomly removes some of the english ones but keeps a majority of them... maybe this is just a work in progress.
It's a great idea and I hope someone gets this working.
Whoopsi
Cidinho
Posted 12:02 PM 16/11/07
I don't know, try -lang:default... I can't try since my Gmail is in Portuguese...
Cidinho
Gina Trapani, Lifehacker Editor
Posted 10:27 AM 16/11/07
No matter what I do, no dice with -lang:english.
Anyone else?
Gina Trapani, Lifehacker Editor
maciejr
Posted 9:25 AM 16/11/07
-lang:english seems to work here!
Maybe you misspelled it?
maciejr
Danomite
Posted 9:10 AM 16/11/07
Merci.
Danomite
engtech
Posted 3:18 PM 16/11/07
hot tip: create a filter to delete/quarantine any non-english emails and you might take out some of the spam that still slips through.
engtech
maciejr
Posted 3:00 PM 16/11/07
@KROM: Yes, of course you are right. Getting no mail from -lang:en would mean it is all seen as English. Getting all mail from it could mean that the tag is unrecognized/unimplemented.
So, what results are you getting? All of your mail or a random subset? Does changing the location in your profile make any difference to search results? Does lang:en give exactly the results NOT returned by -lang:en ? Did you try lang:en-us or similar combinations? (It does not work for me, but this could be locale-specific.)
Ok, this is about all I can think of...
maciejr
krom
Posted 2:44 PM 16/11/07
PS Thanks, this'll hopefully make it easier to delete all the Vietnamese spam I keep getting.
krom
krom
Posted 2:44 PM 16/11/07
macie: The minus sign at the beginning of "-lang:english" would expectedly show all mail NOT in english; just like in regular Google you can put a minus in front of a word or term to exclude it from the results. That's what Gina (and I'd) expects; but it doesn't work that way.
krom
maciejr
Posted 2:38 PM 16/11/07
@Gina: I even tried -lang:en and it works, too! Sorry... BTW the classification is far from perfect, but you could expect that from an unofficial feature. Note that some e-mails mix languages, I bet they also use sender locale to classify it.
If you get all of your mail as results from -lang:en, then maybe Google thinks it is all English?
One more thought: you might try experimenting with changing your Google account locale/language settings. If you prefer not to tamper with your main account it may be safer to create an extra account just for testing. Sign up for several discussion groups to fill the test account with e-mails in various languages.
maciejr
drapetomaniac
Posted 5:29 PM 16/11/07
For english, use the two digit anguage code:
lang:en
for spanish
lang:es
portuguese - pt, spanish es
others:
[service.real.com]
drapetomaniac
JonathanPeterson
Posted 5:58 PM 16/11/07
@krom: Exactly. my filters with copy/pasted cyrilic and japanese characters aren't perfect, but they do some serious damage to that garbage.
JonathanPeterson
J. D. Harper (aka Blog Jones)
Posted 10:57 PM 16/11/07
YAY! Thanks for showing this to me! I've been looking for some way of getting rid of all the Russian spam I get. Now it's funneled directly into the trash.
J. D. Harper (aka Blog Jones)