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

Unified Diff: ext/common.js

Issue 29569659: Issue 4580 - Replace ext.i18n.getMessage with i18n.getMessage (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Rebase Created Oct. 9, 2017, 5:19 a.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 | « desktop-options.js ('k') | i18n.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
@@ -14,16 +14,19 @@
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
(function()
{
+ if (typeof chrome == "undefined")
+ window.chrome = {};
+
if (typeof ext == "undefined")
window.ext = {};
function Page(source)
{
this._source = source;
}
Page.prototype =
@@ -153,18 +156,21 @@
let rawCatalog = JSON.parse(xhr.responseText);
for (let msgId in rawCatalog)
{
if (!(msgId in catalog))
catalog[msgId] = parseMessage(rawCatalog[msgId]);
}
};
- window.ext.i18n = {
- locale: locales[0],
+ chrome.i18n = {
Sebastian Noack 2017/10/09 18:43:54 Shouldn't this rather be browser.i18n, now where w
Manish Jethani 2017/10/09 18:47:02 Yes, assuming that one lands first.
+ getUILanguage()
+ {
+ return locales[0].replace(/_/g, "-");
+ },
getMessage(msgId, substitutions)
{
while (true)
{
let message = catalog[msgId];
if (message)
{
let text = message[0];
« no previous file with comments | « desktop-options.js ('k') | i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld