Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3080 from duckduckgo/brian/forecast-lang
Browse files Browse the repository at this point in the history
Forecast: Use first two chars from locale as language
  • Loading branch information
bsstoner authored Dec 21, 2016
2 parents c53d92e + 6c6b752 commit e3c5162
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/DDG/Spice/Forecast.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ handle remainder => sub {
my $parsed_lang = 'en';
# And try to extract language from locale
if ($lang && $lang->locale) {
($parsed_lang) = $lang->locale =~ /_([A-Z]{2})$/;
$parsed_lang = lc $parsed_lang;
($parsed_lang) = $lang->locale =~ /^([a-z]{2})_/;
}
return $loc_str, $parsed_lang, {is_cached => 0};
};
Expand Down

0 comments on commit e3c5162

Please sign in to comment.