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);
|
final String languageTag = BrowserLocaleManager.getLanguageTag(locale);
|
||||||
String url = getSearchPluginsJarURL(languageTag, fileName);
|
String url = getSearchPluginsJarURL(languageTag, fileName);
|
||||||
|
|
||||||
final InputStream in = GeckoJarReader.getStream(url);
|
InputStream in = GeckoJarReader.getStream(url);
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If that doesn't work, try a file path for just the language.
|
// If that doesn't work, try a file path for just the language.
|
||||||
final String language = BrowserLocaleManager.getLanguage(locale);
|
final String language = BrowserLocaleManager.getLanguage(locale);
|
||||||
if (languageTag.equals(language)) {
|
if (!languageTag.equals(language)) {
|
||||||
// We already tried this, so just return null.
|
url = getSearchPluginsJarURL(language, fileName);
|
||||||
return null;
|
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);
|
return GeckoJarReader.getStream(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user