Skip to content

Commit

Permalink
Make 'Severity' translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Mar 13, 2024
1 parent 13094ee commit 27d87bd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ import { escapeExpression } from "handlebars/runtime";
import { className } from "../../decorators/index";
import translate from "../../helpers/t";

const severities = ["blocker", "critical", "normal", "minor", "trivial"];

@className("pane__section")
class SeverityView extends View {
template(data) {
return data.severity
? `${translate("testResult.severity.name")}: ${escapeExpression(data.severity)}`
: "";
template({ severity }) {
if (!severity) {
return "";
}

if (severities.indexOf(severity) >= 0) {
return `${translate("testResult.severity.name")}: ${translate(`testResult.severity.${severity}`)}`;
}

return `${translate("testResult.severity.name")}: ${escapeExpression(severity)}`;
}

serializeData() {
Expand Down
7 changes: 6 additions & 1 deletion allure-generator/src/main/javascript/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@
"time": "{{date}} at {{time}}"
},
"severity": {
"name": "Severity"
"name": "Severity",
"blocker": "blocker",
"critical": "critical",
"normal": "normal",
"minor": "minor",
"trivial": "trivial"
},
"stats": {
"count": {
Expand Down
7 changes: 6 additions & 1 deletion allure-generator/src/main/javascript/translations/isv.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@
"name": "Minule proby"
},
"severity": {
"name": "Važnost"
"name": "Važnost",
"blocker": "bloker",
"critical": "kritična",
"normal": "obyčajna",
"minor": "mala",
"trivial": "kosmetična"
},
"stats": {
"count": {
Expand Down
7 changes: 6 additions & 1 deletion allure-generator/src/main/javascript/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@
"name": "Powtórzenia"
},
"severity": {
"name": "Ważność"
"name": "Ważność",
"blocker": "bloker",
"critical": "krytyczna",
"normal": "zwyczajna",
"minor": "niewielka",
"trivial": "minimalna"
},
"stats": {
"count": {
Expand Down
7 changes: 6 additions & 1 deletion allure-generator/src/main/javascript/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@
"name": "Перезапуски"
},
"severity": {
"name": "Важность"
"name": "Важность",
"blocker": "блокер",
"critical": "критическая",
"normal": "обычная",
"minor": "невысокая",
"trivial": "минимальная"
},
"stats": {
"count": {
Expand Down

0 comments on commit 27d87bd

Please sign in to comment.