Skip to content

Commit c426f04

Browse files
committed
🐛 fix(i18n): localize security delta tooltips and update action labels
Wrap three delta-badge tooltips (fixed/new/both) and the getSummaryUpdateTooltip "Update one of N containers" / "Update this container" strings in t() calls. Add catalog keys under securityView.deltaTooltips plus securityView.updateOneOfButton and securityView.updateThisContainerButton in en/zh-CN/zh-TW.
1 parent 5b29e13 commit c426f04

4 files changed

Lines changed: 33 additions & 4 deletions

File tree

ui/src/locales/en/listViews.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@
140140
"medium": "Medium",
141141
"low": "Low"
142142
},
143+
"deltaTooltips": {
144+
"fixedSingle": "Update fixes {count} vulnerability",
145+
"fixedMultiple": "Update fixes {count} vulnerabilities",
146+
"newSingle": "Update introduces {count} new vulnerability",
147+
"newMultiple": "Update introduces {count} new vulnerabilities",
148+
"both": "Update: {fixed} fixed, {new} new"
149+
},
150+
"updateOneOfButton": "Update one of {count} containers",
151+
"updateThisContainerButton": "Update this container",
143152
"update": "Update",
144153
"viewInContainers": "View in Containers",
145154
"viewAllInContainers": "View all in Containers",

ui/src/locales/zh-CN/listViews.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@
140140
"medium": "中危",
141141
"low": "低危"
142142
},
143+
"deltaTooltips": {
144+
"fixedSingle": "更新可修复 {count} 个漏洞",
145+
"fixedMultiple": "更新可修复 {count} 个漏洞",
146+
"newSingle": "更新会引入 {count} 个新漏洞",
147+
"newMultiple": "更新会引入 {count} 个新漏洞",
148+
"both": "更新:修复 {fixed} 个,新增 {new} 个"
149+
},
150+
"updateOneOfButton": "更新 {count} 个容器之一",
151+
"updateThisContainerButton": "更新此容器",
143152
"update": "更新",
144153
"viewInContainers": "在容器中查看",
145154
"viewAllInContainers": "在容器中查看全部",

ui/src/locales/zh-TW/listViews.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@
140140
"medium": "中危",
141141
"low": "低危"
142142
},
143+
"deltaTooltips": {
144+
"fixedSingle": "更新可修復 {count} 個漏洞",
145+
"fixedMultiple": "更新可修復 {count} 個漏洞",
146+
"newSingle": "更新會引入 {count} 個新漏洞",
147+
"newMultiple": "更新會引入 {count} 個新漏洞",
148+
"both": "更新:修復 {fixed} 個,新增 {new} 個"
149+
},
150+
"updateOneOfButton": "更新 {count} 個容器之一",
151+
"updateThisContainerButton": "更新此容器",
143152
"update": "更新",
144153
"viewInContainers": "在容器中檢視",
145154
"viewAllInContainers": "在容器中檢視全部",

ui/src/views/SecurityView.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ function getSummaryUpdateTooltip(summary: ImageSummary | null | undefined): stri
277277
}
278278
return t('containerComponents.groupHeader.allBlockedTooltip');
279279
}
280-
return ids.length > 1 ? `Update one of ${ids.length} containers` : 'Update this container';
280+
return ids.length > 1
281+
? t('securityView.updateOneOfButton', { count: ids.length })
282+
: t('securityView.updateThisContainerButton');
281283
}
282284
283285
function resolveContainerChoices(summary: ImageSummary): ContainerChoice[] {
@@ -623,17 +625,17 @@ onUnmounted(() => {
623625
<span class="font-medium dd-text truncate">{{ row.image }}</span>
624626
<AppBadge v-if="row.delta && row.delta.fixed > 0 && row.delta.new === 0"
625627
tone="success" size="xs" class="px-1.5 py-0 shrink-0"
626-
v-tooltip.top="`Update fixes ${row.delta.fixed} vulnerability${row.delta.fixed !== 1 ? 'ies' : 'y'}`">
628+
v-tooltip.top="row.delta.fixed === 1 ? t('securityView.deltaTooltips.fixedSingle', { count: row.delta.fixed }) : t('securityView.deltaTooltips.fixedMultiple', { count: row.delta.fixed })">
627629
<AppIcon name="trending-down" :size="9" class="mr-0.5" />{{ row.delta.fixed }} fixed
628630
</AppBadge>
629631
<AppBadge v-else-if="row.delta && row.delta.new > 0 && row.delta.fixed === 0"
630632
tone="warning" size="xs" class="px-1.5 py-0 shrink-0"
631-
v-tooltip.top="`Update introduces ${row.delta.new} new vulnerability${row.delta.new !== 1 ? 'ies' : 'y'}`">
633+
v-tooltip.top="row.delta.new === 1 ? t('securityView.deltaTooltips.newSingle', { count: row.delta.new }) : t('securityView.deltaTooltips.newMultiple', { count: row.delta.new })">
632634
<AppIcon name="trending-up" :size="9" class="mr-0.5" />{{ row.delta.new }} new
633635
</AppBadge>
634636
<AppBadge v-else-if="row.delta && (row.delta.fixed > 0 || row.delta.new > 0)"
635637
tone="caution" size="xs" class="px-1.5 py-0 shrink-0"
636-
v-tooltip.top="`Update: ${row.delta.fixed} fixed, ${row.delta.new} new`">
638+
v-tooltip.top="t('securityView.deltaTooltips.both', { fixed: row.delta.fixed, new: row.delta.new })">
637639
{{ row.delta.fixed }} fixed, {{ row.delta.new }} new
638640
</AppBadge>
639641
<template v-if="row.hasUpdate">

0 commit comments

Comments
 (0)