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

Unified Diff: i18n.js

Issue 29573083: Issue 5028 - Use browser namespace (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Add polyfill.js to README.md Created Oct. 17, 2017, 12:35 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 | « firstRun.js ('k') | lib/antiadblockInit.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: i18n.js
===================================================================
--- a/i18n.js
+++ b/i18n.js
@@ -16,17 +16,17 @@
*/
"use strict";
// Getting UI locale cannot be done synchronously on Firefox,
// requires messaging the background page. For Chrome and Safari,
// we could get the UI locale here, but would need to duplicate
// the logic implemented in Utils.appLocale.
-chrome.runtime.sendMessage(
+browser.runtime.sendMessage(
{
type: "app.get",
what: "localeInfo"
},
(localeInfo) =>
{
document.documentElement.lang = localeInfo.locale;
document.documentElement.dir = localeInfo.bidiDir;
@@ -53,17 +53,17 @@
processString(match[4], currentElement);
}
else
currentElement.appendChild(document.createTextNode(str));
}
while (element.lastChild)
element.removeChild(element.lastChild);
- processString(chrome.i18n.getMessage(stringName, args), element);
+ processString(browser.i18n.getMessage(stringName, args), element);
}
};
// Loads i18n strings
function loadI18nStrings()
{
function addI18nStringsToElements(containerElement)
{
« no previous file with comments | « firstRun.js ('k') | lib/antiadblockInit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld