Rename & organize linter messages

This commit is contained in:
Rob Garrison 2017-08-26 11:48:32 -05:00
parent 1d1a2ce1c8
commit 1e03910b0b
16 changed files with 69 additions and 69 deletions

View File

@ -27,7 +27,7 @@
"message": "Изнасяне", "message": "Изнасяне",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Проблеми", "message": "Проблеми",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -664,7 +664,7 @@
"message": "Прозорец за настройките", "message": "Прозорец за настройките",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Проблеми, намерени от $link$ при следните правила:", "message": "Проблеми, намерени от $link$ при следните правила:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "Exportovat", "message": "Exportovat",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Problémy", "message": "Problémy",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -652,7 +652,7 @@
"message": "Možnosti rozhraní", "message": "Možnosti rozhraní",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Problémy nalezené aplikací $link$ s těmito povolenými pravidly:", "message": "Problémy nalezené aplikací $link$ s těmito povolenými pravidly:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "Exportieren", "message": "Exportieren",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Probleme", "message": "Probleme",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -632,7 +632,7 @@
"message": "Optionen", "message": "Optionen",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Die von $link$ gefunden Fehler haben die folgenden Einstellungen:", "message": "Die von $link$ gefunden Fehler haben die folgenden Einstellungen:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -349,11 +349,23 @@
"message": "Install update", "message": "Install update",
"description": "Label for the button to install an update for a single style" "description": "Label for the button to install an update for a single style"
}, },
"issues": { "linterConfigTitle": {
"message": "Open a popup to configure the linter rules",
"description": "Tooltip on an icon to indicate it opens a popup with linter configuration settings"
},
"linterCSSLintSettings": {
"message": "(Set rules: 0 = disabled; 1 = warning; 2 = error)",
"description": "CSSLint rule settings values"
},
"linterInvalidRuleError": {
"message": "Not saved due to these invalid rules:",
"description": "Invalid linter rules will show a message followed by a list of invalid rules"
},
"linterIssues": {
"message": "Issues", "message": "Issues",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "The issues found by $link$ rules:", "message": "The issues found by $link$ rules:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {
@ -362,9 +374,26 @@
} }
} }
}, },
"linterConfigTitle": { "linterJSONError": {
"message": "Open a popup to configure the linter rules", "message": "Invalid JSON format",
"description": "Tooltip on an icon to indicate it opens a popup with linter configuration settings" "description": "Setting linter rules with invalid JSON message"
},
"linterResetMessage": {
"message": "To undo accidental reset, press Ctrl-Z (or Cmd-Z) in the text box",
"description": "Reset button tooltip to inform user on how to undo an accidental reset"
},
"linterRulesLink": {
"message": "See a full list of rules",
"description": "Stylelint or CSSLint rules label added before a link"
},
"linterRulesTitle": {
"message": "Set rules for $linter$",
"description": "Stylelint or CSSLint popup header",
"placeholders": {
"linter": {
"content": "$1"
}
}
}, },
"manageFilters": { "manageFilters": {
"message": "Filters", "message": "Filters",
@ -518,35 +547,6 @@
"message": "Remove section", "message": "Remove section",
"description": "Label for the button to remove a section" "description": "Label for the button to remove a section"
}, },
"setLinterLink": {
"message": "See a full list of rules",
"description": "Stylelint or CSSLint rules label added before a link"
},
"setLinterRulesTitle": {
"message": "Set rules for $linter$",
"description": "Stylelint or CSSLint popup header",
"placeholders": {
"linter": {
"content": "$1"
}
}
},
"setLinterError": {
"message": "Invalid JSON format",
"description": "Setting linter rules with invalid JSON message"
},
"setLinterInvalidRuleError": {
"message": "Not saved due to these invalid rules:",
"description": "Invalid linter rules will show a message followed by a list of invalid rules"
},
"setLinterResetMessage": {
"message": "To undo accidental reset, press Ctrl-Z (or Cmd-Z) in the text box",
"description": "Reset button tooltip to inform user on how to undo an accidental reset"
},
"showCSSLintSettings": {
"message": "(Set rules: 0 = disabled; 1 = warning; 2 = error)",
"description": "CSSLint rule settings values"
},
"shortcuts": { "shortcuts": {
"message": "Shortcuts", "message": "Shortcuts",
"description": "Go to shortcut configuration" "description": "Go to shortcut configuration"

View File

@ -27,7 +27,7 @@
"message": "Exportar", "message": "Exportar",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Problemas", "message": "Problemas",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -656,7 +656,7 @@
"message": "Interfaz de opciones", "message": "Interfaz de opciones",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Problemas encontrados por $link$ con estas reglas aplicadas:", "message": "Problemas encontrados por $link$ con estas reglas aplicadas:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "Ekspordi", "message": "Ekspordi",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Vead", "message": "Vead",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -652,7 +652,7 @@
"message": "Valikute liides", "message": "Valikute liides",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "$link$ poolt leitud vead nende lubatud reeglitega:", "message": "$link$ poolt leitud vead nende lubatud reeglitega:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "エクスポート", "message": "エクスポート",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "問題点", "message": "問題点",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -648,7 +648,7 @@
"message": "オプション UI", "message": "オプション UI",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "これらのルールを有効にして $link$ で見つかった問題:", "message": "これらのルールを有効にして $link$ で見つかった問題:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -11,7 +11,7 @@
"message": "Exporteren", "message": "Exporteren",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Problemen", "message": "Problemen",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -344,7 +344,7 @@
"message": "Controleer alle stijlen op updates", "message": "Controleer alle stijlen op updates",
"description": "Label for the button to check all styles for updates" "description": "Label for the button to check all styles for updates"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "De door stylelint gevonden problemen, $link$, met deze ingeschakelde regels:", "message": "De door stylelint gevonden problemen, $link$, met deze ingeschakelde regels:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "Eksportuj", "message": "Eksportuj",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Problemy", "message": "Problemy",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -656,7 +656,7 @@
"message": "Opcje interfejsu", "message": "Opcje interfejsu",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Problemy znalezione przez $link$ z tymi włączonymi regułami:", "message": "Problemy znalezione przez $link$ z tymi włączonymi regułami:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "Экспорт", "message": "Экспорт",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Проблемы", "message": "Проблемы",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -656,7 +656,7 @@
"message": "Настройки", "message": "Настройки",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Проблемы и предупреждения по версии $link$ с данными включенными правилами:", "message": "Проблемы и предупреждения по версии $link$ с данными включенными правилами:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -11,7 +11,7 @@
"message": "Извези", "message": "Извези",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "Проблеми", "message": "Проблеми",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -356,7 +356,7 @@
"message": "Проверите ажурирања за све стилове", "message": "Проверите ажурирања за све стилове",
"description": "Label for the button to check all styles for updates" "description": "Label for the button to check all styles for updates"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "Проблем пронађен од стране $link$ са овим омогућеним правилима:", "message": "Проблем пронађен од стране $link$ са овим омогућеним правилима:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "导出", "message": "导出",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "问题", "message": "问题",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -656,7 +656,7 @@
"message": "设置用户界面", "message": "设置用户界面",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "$link$ 在已启用的这些规则中找到问题:", "message": "$link$ 在已启用的这些规则中找到问题:",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -27,7 +27,7 @@
"message": "導出", "message": "導出",
"description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)" "description": "Label for the button to export a style ('edit' page) or all styles ('manage' page)"
}, },
"issues": { "linterIssues": {
"message": "問題", "message": "問題",
"description": "Label for the CSS linter issues block on the style edit page" "description": "Label for the CSS linter issues block on the style edit page"
}, },
@ -660,7 +660,7 @@
"message": "選項介面", "message": "選項介面",
"description": "Go to Options UI" "description": "Go to Options UI"
}, },
"issuesHelp": { "linterIssuesHelp": {
"message": "由$link$發現啟用這些規則會產生衝突", "message": "由$link$發現啟用這些規則會產生衝突",
"description": "Help popup message for the selected CSS linter issues block on the style edit page", "description": "Help popup message for the selected CSS linter issues block on the style edit page",
"placeholders": { "placeholders": {

View File

@ -195,7 +195,7 @@
</svg>&nbsp; </svg>&nbsp;
</span> </span>
</section> </section>
<section id="lint"><h2 i18n-text="issues">: <span id="issue-count"></span><svg id="lint-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></h2><div></div></section> <section id="lint"><h2 i18n-text="linterIssues">: <span id="issue-count"></span><svg id="lint-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></h2><div></div></section>
</div> </div>
<section id="sections"> <section id="sections">
<h2><span id="sections-heading" i18n-text="styleSectionsTitle"></span><svg id="sections-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></h2> <h2><span id="sections-heading" i18n-text="styleSectionsTitle"></span><svg id="sections-help" class="svg-icon info"><use xlink:href="#svg-icon-help"/></svg></h2>

View File

@ -1571,7 +1571,7 @@ function fromMozillaFormat() {
firstAddedCM.focus(); firstAddedCM.focus();
if (errors.length) { if (errors.length) {
showHelp(t('issues'), $element({ showHelp(t('linterIssues'), $element({
tag: 'pre', tag: 'pre',
textContent: errors.join('\n'), textContent: errors.join('\n'),
})); }));

View File

@ -217,13 +217,13 @@ function showLintHelp() {
if (linter === 'csslint') { if (linter === 'csslint') {
const CSSLintRules = window.CSSLint.getRules(); const CSSLintRules = window.CSSLint.getRules();
const findCSSLintRule = id => CSSLintRules.find(rule => rule.id === id); const findCSSLintRule = id => CSSLintRules.find(rule => rule.id === id);
header = t('issuesHelp', makeLink('https://github.com/CSSLint/csslint/wiki/Rules-by-ID', 'CSSLint')); header = t('linterIssuesHelp', makeLink('https://github.com/CSSLint/csslint/wiki/Rules-by-ID', 'CSSLint'));
template = ruleID => { template = ruleID => {
const rule = findCSSLintRule(ruleID); const rule = findCSSLintRule(ruleID);
return rule ? `<li><b>${makeLink(rule.url || url, rule.name)}</b><br>${rule.desc}</li>` : ''; return rule ? `<li><b>${makeLink(rule.url || url, rule.name)}</b><br>${rule.desc}</li>` : '';
}; };
} else { } else {
header = t('issuesHelp', makeLink(url, 'stylelint')); header = t('linterIssuesHelp', makeLink(url, 'stylelint'));
template = rule => `<li>${makeLink(url + rule, rule)}</li>`; template = rule => `<li>${makeLink(url + rule, rule)}</li>`;
} }
// to-do: change this to a generator // to-do: change this to a generator
@ -234,7 +234,7 @@ function showLintHelp() {
rules.push(rule); rules.push(rule);
} }
}); });
return showHelp(t('issues'), header + list + '</ul>'); return showHelp(t('linterIssues'), header + list + '</ul>');
} }
function showLinterErrorMessage(title, contents) { function showLinterErrorMessage(title, contents) {
@ -294,7 +294,7 @@ function setupLinterSettingsEvents(popup) {
if (invalid.length) { if (invalid.length) {
return showLinterErrorMessage( return showLinterErrorMessage(
linter, linter,
t('setLinterInvalidRuleError') + `<ul><li>${invalid.join('</li><li>')}</li></ul>` t('linterInvalidRuleError') + `<ul><li>${invalid.join('</li><li>')}</li></ul>`
); );
} }
if (linter === 'stylelint') { if (linter === 'stylelint') {
@ -305,7 +305,7 @@ function setupLinterSettingsEvents(popup) {
updateLinter(linter); updateLinter(linter);
showSavedMessage(); showSavedMessage();
} else { } else {
showLinterErrorMessage(linter, t('setLinterError')); showLinterErrorMessage(linter, t('linterJSONError'));
} }
popup.codebox.focus(); popup.codebox.focus();
}); });
@ -365,24 +365,24 @@ function setupLinterPopup(rules) {
cm.setOption('mode', 'application/json'); cm.setOption('mode', 'application/json');
cm.setOption('lint', 'json'); cm.setOption('lint', 'json');
} }
const popup = showCodeMirrorPopup(t('setLinterRulesTitle', linterTitle), $element({ const popup = showCodeMirrorPopup(t('linterRulesTitle', linterTitle), $element({
appendChild: [ appendChild: [
$element({ $element({
tag: 'p', tag: 'p',
appendChild: [ appendChild: [
t('setLinterLink') + ' ', t('linterRulesLink') + ' ',
makeLink( makeLink(
linter === 'stylelint' linter === 'stylelint'
? 'https://stylelint.io/demo/' ? 'https://stylelint.io/demo/'
: 'https://github.com/CSSLint/csslint/wiki/Rules-by-ID', : 'https://github.com/CSSLint/csslint/wiki/Rules-by-ID',
linterTitle linterTitle
), ),
linter === 'csslint' ? ' ' + t('showCSSLintSettings') : '' linter === 'csslint' ? ' ' + t('linterCSSLintSettings') : ''
] ]
}), }),
makeButton('save', 'styleSaveLabel'), makeButton('save', 'styleSaveLabel'),
makeButton('cancel', 'confirmCancel'), makeButton('cancel', 'confirmCancel'),
makeButton('reset', 'genericResetLabel', {title: t('setLinterResetMessage')}), makeButton('reset', 'genericResetLabel', {title: t('linterResetMessage')}),
$element({ $element({
tag: 'span', tag: 'span',
className: 'saved-message', className: 'saved-message',