mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1067026 - Fall back to en-US if search plugins aren't found for the user's locale. r=rnewman
This commit is contained in:
parent
60c559be95
commit
c8dc3c02d7
@ -233,19 +233,23 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
|
||||
final String languageTag = BrowserLocaleManager.getLanguageTag(locale);
|
||||
String url = getSearchPluginsJarURL(languageTag, fileName);
|
||||
|
||||
final InputStream in = GeckoJarReader.getStream(url);
|
||||
InputStream in = GeckoJarReader.getStream(url);
|
||||
if (in != null) {
|
||||
return in;
|
||||
}
|
||||
|
||||
// If that doesn't work, try a file path for just the language.
|
||||
final String language = BrowserLocaleManager.getLanguage(locale);
|
||||
if (languageTag.equals(language)) {
|
||||
// We already tried this, so just return null.
|
||||
return null;
|
||||
if (!languageTag.equals(language)) {
|
||||
url = getSearchPluginsJarURL(language, fileName);
|
||||
in = GeckoJarReader.getStream(url);
|
||||
if (in != null) {
|
||||
return in;
|
||||
}
|
||||
}
|
||||
|
||||
url = getSearchPluginsJarURL(language, fileName);
|
||||
// Finally, fall back to en-US.
|
||||
url = getSearchPluginsJarURL("en-US", fileName);
|
||||
return GeckoJarReader.getStream(url);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user