From f35fbb5b3660f7349df5de0e50b17b293316670f Mon Sep 17 00:00:00 2001 From: eight Date: Wed, 1 Nov 2017 09:46:03 +0800 Subject: [PATCH] Fix: add styleMetaErrorSelectValueMismatch --- _locales/en/messages.json | 4 ++++ js/usercss.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index cedf94e3..163ef8df 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -773,6 +773,10 @@ } } }, + "styleMetaErrorSelectValueMismatch": { + "message": "Invalid @select: value doesn't exist in the list", + "description": "Error displayed when the value of @select is invalid" + }, "styleMissingMeta": { "message": "Missing metadata @$key$", "description": "Error displayed when a mandatory metadata is missing", diff --git a/js/usercss.js b/js/usercss.js index 161d8d59..b05c83d5 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -512,7 +512,7 @@ var usercss = (() => { function validVar(va, value = 'default') { if (va.type === 'select' || va.type === 'dropdown') { if (va.options.every(o => o.value !== va[value])) { - throw new Error(chrome.i18n.getMessage('invalid select value')); + throw new Error(chrome.i18n.getMessage('styleMetaErrorSelectValueMismatch')); } } else if (va.type === 'checkbox' && !/^[01]$/.test(va[value])) { throw new Error(chrome.i18n.getMessage('styleMetaErrorCheckbox'));