From 7842ac752a2798eb629eba9fa1bc4df8325d9b17 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 9 Nov 2017 08:56:25 +0800 Subject: [PATCH] i18n: styleMetaErrorPreprocessor --- _locales/en/messages.json | 9 +++++++++ js/usercss.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d8b8cb9f..721559ca 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -773,6 +773,15 @@ } } }, + "styleMetaErrorPreprocessor": { + "message": "Unsupported @preprocessor: $preprocessor$", + "description": "Error displayed when the value of @preprocessor is not supported", + "placeholders": { + "preprocessor": { + "content": "$1" + } + } + }, "styleMetaErrorSelectValueMismatch": { "message": "Invalid @select: value doesn't exist in the list", "description": "Error displayed when the value of @select is invalid" diff --git a/js/usercss.js b/js/usercss.js index 1f4d88ce..e6e359bd 100644 --- a/js/usercss.js +++ b/js/usercss.js @@ -403,7 +403,7 @@ var usercss = (() => { let builder; if (preprocessor) { if (!BUILDER[preprocessor]) { - return Promise.reject(new Error(`Unsupported preprocessor: ${preprocessor}`)); + return Promise.reject(chrome.i18n.getMessage('styleMetaErrorPreprocessor', preprocessor)); } builder = BUILDER[preprocessor]; } else {