Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/common.js

Issue 29345232: Issue 4084 - Do not use @@bidi_dir directly in adblockplusui (Closed)
Patch Set: Rebase Created Aug. 28, 2017, 4:58 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« background.js ('K') | « background.js ('k') | messageResponder.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/common.js
===================================================================
--- a/ext/common.js
+++ b/ext/common.js
@@ -99,24 +99,13 @@
return candidates;
};
- let initCatalog = function(uiLocale)
- {
- let bidiDir = /^(ar|fa|he|ug|ur)(-|$)/.test(uiLocale) ? "rtl" : "ltr";
- let catalog = Object.create(null);
-
- catalog["@@ui_locale"] = [uiLocale.replace(/-/g, "_"), []];
- catalog["@@bidi_dir"] = [bidiDir, []];
-
- return catalog;
- };
-
let selectedLocale = window.navigator.language;
let match = /[?&]locale=([\w-]+)/.exec(window.location.search);
if (match)
selectedLocale = match[1];
let locales = getLocaleCandidates(selectedLocale);
- let catalog = initCatalog(locales[0]);
+ let catalog = Object.create(null);
let catalogFile = window.location.pathname.replace(/.*\//, "")
.replace(/\..*/, "") + ".json";
@@ -170,6 +159,7 @@
};
window.ext.i18n = {
+ locale: locales[0],
getMessage(msgId, substitutions)
{
while (true)
« background.js ('K') | « background.js ('k') | messageResponder.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld