Bug 279952 - add en-US to the fallback list for locale providers, preferring it to "any old locale we can find" r=darin

This commit is contained in:
bsmedberg%covad.net 2005-03-30 11:41:47 +00:00
parent 84cfc83215
commit ddbd869e4c
2 changed files with 11 additions and 3 deletions

View File

@ -187,7 +187,15 @@ nsChromeRegistry::nsProviderArray::GetProvider(const nsACString& aPreferred, Mat
if (aPreferred.Equals(entry->provider))
return entry;
if (aType == LOCALE && !found && LanguagesMatch(aPreferred, entry->provider))
if (aType != LOCALE)
continue;
if (LanguagesMatch(aPreferred, entry->provider)) {
found = entry;
continue;
}
if (!found && entry->provider.EqualsLiteral("en-US"))
found = entry;
}
@ -609,7 +617,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult)
baseURI = entry->locales.GetBase(mSelectedLocale, nsProviderArray::LOCALE);
}
else if (provider.EqualsLiteral("skin")) {
baseURI = entry->skins.GetBase(mSelectedSkin, nsProviderArray::SKIN);
baseURI = entry->skins.GetBase(mSelectedSkin, nsProviderArray::ANY);
}
else {
baseURI = entry->baseURI;

View File

@ -144,7 +144,7 @@ public:
enum MatchType {
EXACT = 0,
LOCALE = 1, // "en-GB" is selected, we found "en-US"
SKIN = 2
ANY = 2
};
ProviderEntry* GetProvider(const nsACString& aPreferred, MatchType aType);