Bug 1312049 - Switch nsChromeRegistry::GetDirectionForLocale to use uloc_isRightToLeft. r=gandalf

This commit is contained in:
Jonathan Kew 2016-10-28 12:04:07 +01:00
parent 22a661f150
commit 93d9efc143
2 changed files with 8 additions and 0 deletions

View File

@ -650,6 +650,11 @@ nsChromeRegistry::MustLoadURLRemotely(nsIURI *aURI, bool *aResult)
bool
nsChromeRegistry::GetDirectionForLocale(const nsACString& aLocale)
{
#ifdef ENABLE_INTL_API
nsAutoCString locale(aLocale);
SanitizeForBCP47(locale);
return uloc_isRightToLeft(locale.get());
#else
// first check the intl.uidirection.<locale> preference, and if that is not
// set, check the same preference but with just the first two characters of
// the locale. If that isn't set, default to left-to-right.
@ -670,6 +675,7 @@ nsChromeRegistry::GetDirectionForLocale(const nsACString& aLocale)
}
return dir.EqualsLiteral("rtl");
#endif
}
NS_IMETHODIMP_(bool)

View File

@ -2047,12 +2047,14 @@ pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", false)
// ideographic space will be ignored (i.e., commits with empty string).
pref("intl.ime.remove_placeholder_character_at_commit", false);
#ifndef ENABLE_INTL_API
// these locales have right-to-left UI
pref("intl.uidirection.ar", "rtl");
pref("intl.uidirection.he", "rtl");
pref("intl.uidirection.fa", "rtl");
pref("intl.uidirection.ug", "rtl");
pref("intl.uidirection.ur", "rtl");
#endif
// use en-US hyphenation by default for content tagged with plain lang="en"
pref("intl.hyphenation-alias.en", "en-us");