Index: chrome/content/ui/i18n.js |
=================================================================== |
--- a/chrome/content/ui/i18n.js |
+++ b/chrome/content/ui/i18n.js |
@@ -16,14 +16,13 @@ |
*/ |
var i18n; |
+var locale; |
if (typeof ext != "undefined") |
+{ |
i18n = ext.i18n; |
-else if (typeof chrome != "undefined") |
- // TODO: This check only exist for backwards compatibility, while the Safari |
- // port isn't merged into the adblockpluschrome repo. So this branch should |
- // be removed when the Safari port was merged. |
- i18n = chrome.i18n; |
+ locale = ext.i18n.getMessage("@@ui_locale").replace(/_/g, "-"); |
+} |
else |
{ |
// Using Firefox' approach on i18n instead |
@@ -84,6 +83,8 @@ |
} |
}; |
})(); |
+ |
+ locale = require("utils").Utils.appLocale; |
} |
// Inserts i18n strings into matching elements. Any inner HTML already in the element is |
@@ -146,5 +147,14 @@ |
return [timeString, d.toLocaleDateString()]; |
} |
-// Fill in the strings as soon as possible |
-window.addEventListener("DOMContentLoaded", loadI18nStrings, true); |
+function onDOMLoaded() |
+{ |
+ document.documentElement.lang = locale; |
+ |
+ if (locale == "ar" || locale == "he" || locale == "fa") |
+ document.documentElement.dir = "rtl"; |
+ |
+ loadI18nStrings(); |
+} |
+ |
+window.addEventListener("DOMContentLoaded", onDOMLoaded, true); |