From b1d4e4a6997d0bddb18d7a2fd7c4b34194bc39a4 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 14 Jan 2014 08:41:41 -0500 Subject: [PATCH] Bug 958985 - Make isBidiEnabled check the intl.uidirection. pref; r=smontagu --- browser/base/content/utilityOverlay.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 6590bd91088b..55a6f6bf3030 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -425,8 +425,13 @@ function isBidiEnabled() { if (getBoolPref("bidi.browser.ui", false)) return true; - // if the pref isn't set, check for an RTL locale and force the pref to true - // if we find one. + // then check intl.uidirection. + var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]. + getService(Ci.nsIXULChromeRegistry); + if (chromeReg.isLocaleRTL("global")) + return true; + + // now see if the system locale is an RTL one. var rv = false; try { @@ -438,6 +443,7 @@ function isBidiEnabled() { case "ar-": case "he-": case "fa-": + case "ug-": case "ur-": case "syr": rv = true;