How can I guess the two letter language code for a Google suggestions feature?
<p>I've implemented a very simple Google suggestions feature based on what I've found here: <a href="http://shreyaschand.com/blog/2013/01/03/google-autocomplete-api/" rel="nofollow">http://shreyaschand.com/blog/2013/01/03/google-autocomplete-api/</a></p>

<p>You don't even have to use an XML parser:</p>

<pre><code>+ (NSArray *)suggestionsForQuery:(NSString *)query language:(NSString *)language
{
    NSMutableArray *suggestions;

    NSString *URLString = [NSString stringWithFormat:@"http://suggestqueries.google.com/complete/search?q=%@&amp;client=toolbar&amp;hl=%@", query, language];

    NSError *error = nil;

    NSString *XMLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:URLString] encoding:NSUTF8StringEncoding error:&amp;error];

    if (error) {

        NSLog(@"ERROR {%@}", error.description);
    }
    else {

        XMLString = [XMLString stringByReplacingOccurrencesOfString:@"&lt;?xml version=\"1.0\"?&gt;" withString:@""];

        XMLString = [XMLString stringByReplacingOccurrencesOfString:@"&lt;toplevel&gt;" withString:@""];

        XMLString = [XMLString stringByReplacingOccurrencesOfString:@"&lt;/toplevel&gt;" withString:@""];

        XMLString = [XMLString stringByReplacingOccurrencesOfString:@"&lt;CompleteSuggestion&gt;" withString:@""];

        XMLString = [XMLString stringByReplacingOccurrencesOfString:@"&lt;/CompleteSuggestion&gt;" withString:@""];

        XMLString = [XMLString stringByReplacingOccurrencesOfString:@"&lt;suggestion data=\"" withString:@""];

        suggestions = [NSMutableArray arrayWithArray:[XMLString componentsSeparatedByString:@"\"/&gt;"]];

        [suggestions removeLastObject];
    }

    return suggestions;
}
</code></pre>

<p>It works but only if you already know the two letter language code.</p>

<p>Do you know of any way in which I can guess the two letter language code based on the location the user is searching from?</p>

<p>If it's strictly based on location, I wouldn't like it if let's say a user has gone on vacation in France and all of a sudden suggestions change to Google France.</p>

<p>Should it be based on what language the user is already using on his iOS device?</p>