From 20481c9180ac9dbff52567a8cbfeebb4f1ce77f1 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 12 Sep 2017 01:59:56 +0800 Subject: [PATCH] Fix: i18n config dialog --- _locales/en/messages.json | 4 ++++ manage/config-dialog.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index eb92a02c..8c297dbc 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -7,6 +7,10 @@ "message": "Add Style", "description": "Title of the page for adding styles" }, + "alphaChannel": { + "message": "Alpha channel", + "description": "Label of alpha channel input" + }, "appliesAdd": { "message": "Add", "description": "Label for the button to add an 'applies' entry" diff --git a/manage/config-dialog.js b/manage/config-dialog.js index 6386629c..82e0a38f 100644 --- a/manage/config-dialog.js +++ b/manage/config-dialog.js @@ -33,8 +33,14 @@ function configDialog(style) { let appendChild; if (va.type === 'color') { va.inputColor = $element({tag: 'input', type: 'color'}); - // FIXME: i18n - va.inputAlpha = $element({tag: 'input', type: 'range', min: 0, max: 1, title: 'Opacity', step: 'any'}); + va.inputAlpha = $element({ + tag: 'input', + type: 'range', + min: 0, + max: 1, + title: chrome.i18n.getMessage('alphaChannel'), + step: 'any' + }); va.inputColor.onchange = va.inputAlpha.oninput = () => { va.dirty = true; const color = colorParser.parse(va.inputColor.value);