1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 04:26:35 +02:00

Moved i18n to extension module

This commit is contained in:
kkapsner 2019-04-09 08:29:52 +02:00
parent d89bfe4cb0
commit bab7d1496f
17 changed files with 101 additions and 85 deletions

View file

@ -47,7 +47,7 @@
actions.forEach(function(action, i){
var button = document.createElement("button");
button.className = action.name + " action";
button.title = browser.i18n.getMessage(action.name);
button.title = extension.getTranslation(action.name);
if (action.isIcon || action.icon){
button.classList.add("isIcon");
var img = document.createElement("img");

View file

@ -4,6 +4,7 @@
(function(){
"use strict";
const extension = require("../lib/extension");
const settings = require("../lib/settings");
const {parseErrorStack} = require("../lib/callingStack");
const {error, warning, message, notice, verbose, setPrefix: setLogPrefix} = require("../lib/logging");
@ -102,8 +103,8 @@
domainOrUrlPicker(
domain,
urls,
browser.i18n.getMessage("selectIgnore"),
browser.i18n.getMessage("inputIgnoreURL")
extension.getTranslation("selectIgnore"),
extension.getTranslation("inputIgnoreURL")
).then(function(choice){
if (choice){
settings.set("showNotifications", false, choice).then(function(){
@ -123,8 +124,8 @@
domainOrUrlPicker(
domain,
urls,
browser.i18n.getMessage("selectWhitelist"),
browser.i18n.getMessage("inputWhitelistURL")
extension.getTranslation("selectWhitelist"),
extension.getTranslation("inputWhitelistURL")
).then(function(choice){
if (choice){
settings.set("blockMode", "allow", choice).then(function(){
@ -144,8 +145,8 @@
domainOrUrlPicker(
domain,
urls,
browser.i18n.getMessage("selectSessionWhitelist"),
browser.i18n.getMessage("inputSessionWhitelistURL")
extension.getTranslation("selectSessionWhitelist"),
extension.getTranslation("inputSessionWhitelistURL")
).then(function(choice){
if (choice){
lists.appendTo("sessionWhite", choice).then(function(){