fix KeepRight warnings showing up as "Unknown" issues (close #8925)

This commit is contained in:
Martin Raifer
2022-02-07 10:42:36 +01:00
parent fe15d69b0c
commit 04f77be5bc
3 changed files with 12 additions and 10 deletions
+5 -5
View File
@@ -4,7 +4,7 @@ import {
import { presetManager } from '../presets';
import { modeSelect } from '../modes/select';
import { t } from '../core/localizer';
import { t, localizer } from '../core/localizer';
import { utilDisplayName, utilHighlightEntities, utilEntityRoot } from '../util';
@@ -18,11 +18,11 @@ export function uiKeepRightDetails(context) {
let replacements = d.replacements || {};
replacements.default = unknown; // special key `default` works as a fallback string
let detail = t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
if (detail === unknown.html) {
detail = t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
if (localizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
return t.html(`QA.keepRight.errorTypes.${itemType}.description`, replacements);
} else {
return t.html(`QA.keepRight.errorTypes.${parentIssueType}.description`, replacements);
}
return detail;
}
+5 -5
View File
@@ -1,5 +1,5 @@
import { svgIcon } from '../svg/icon';
import { t } from '../core/localizer';
import { t, localizer } from '../core/localizer';
export function uiKeepRightHeader() {
@@ -12,11 +12,11 @@ export function uiKeepRightHeader() {
let replacements = d.replacements || {};
replacements.default = { html: unknown }; // special key `default` works as a fallback string
let title = t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
if (title === unknown) {
title = t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
if (localizer.hasTextForStringId(`QA.keepRight.errorTypes.${itemType}.title`)) {
return t.html(`QA.keepRight.errorTypes.${itemType}.title`, replacements);
} else {
return t.html(`QA.keepRight.errorTypes.${parentIssueType}.title`, replacements);
}
return title;
}