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]; |