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: Do not pretent to support getMessage for @@ui_locale and @@bidi_dir Created May 30, 2016, 4:59 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
« no previous file with comments | « 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
diff --git a/ext/common.js b/ext/common.js
index 630e1cabbbd7e304b71dd912981f4a448b726b2a..57641a5e2dd748f4c671443d4579032a1c7128a4 100644
--- a/ext/common.js
+++ b/ext/common.js
@@ -98,24 +98,13 @@
return candidates;
};
- var initCatalog = function(uiLocale)
- {
- var bidiDir = /^(ar|fa|he|ug|ur)(-|$)/.test(uiLocale) ? "rtl" : "ltr";
- var catalog = Object.create(null);
-
- catalog["@@ui_locale"] = [uiLocale.replace(/-/g, "_"), []];
- catalog["@@bidi_dir" ] = [bidiDir, []];
-
- return catalog;
- };
-
var selectedLocale = window.navigator.language;
var match = /[?&]locale=([\w\-]+)/.exec(window.location.search);
if (match)
selectedLocale = match[1];
var locales = getLocaleCandidates(selectedLocale);
- var catalog = initCatalog(locales[0]);
+ var catalog = Object.create(null);
var catalogFile = window.location.pathname.replace(/.*\//, "").replace(/\..*/, "") + ".json";
var replacePlaceholder = function(text, placeholder, content)
@@ -168,6 +157,7 @@
};
global.ext.i18n = {
+ locale: locales[0],
getMessage: function(msgId, substitutions)
{
while (true)
« no previous file with comments | « background.js ('k') | messageResponder.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld