Skip to content

Commit 79b472f

Browse files
committed
🐛 fix(i18n): localize container row tooltips, aria labels, and empty state
Wrap blocked-update tooltip (blockedTag/blockedTagWithCriticals/CVEs), manual-update-only tooltip (manualUpdateOnly/WithMessage), four aria-label attributes (ariaRegistryError, ariaSnoozedUpdates, ariaSkippedUpdates, ariaMaturityBlocked), and empty state message in ContainersGroupedViews.vue. Wire to existing keys where present; add new keys for blocked/manual in en/zh-CN/zh-TW containerComponents.json.
1 parent c426f04 commit 79b472f

4 files changed

Lines changed: 33 additions & 13 deletions

File tree

ui/src/components/containers/ContainersGroupedViews.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,13 @@ function blockedUpdateTooltip(container: {
279279
const summary = container.updateSecuritySummary;
280280
const critical = summary?.critical ?? 0;
281281
if (critical > 0) {
282-
const noun = critical === 1 ? 'critical CVE' : 'critical CVEs';
283-
return `Blocked: ${tag} (${critical} ${noun})`;
282+
const key =
283+
critical === 1
284+
? 'containerComponents.groupedViews.blockedTagWithCriticals'
285+
: 'containerComponents.groupedViews.blockedTagWithCriticalsCVEs';
286+
return t(key, { tag, count: critical });
284287
}
285-
return `Blocked: ${tag}`;
288+
return t('containerComponents.groupedViews.blockedTag', { tag });
286289
}
287290
288291
function canCancelUpdate(c: { updateOperation?: { status?: string; id?: string } }): boolean {
@@ -320,7 +323,9 @@ function updateBtnTooltip(c: {
320323
if (state === 'hard') return blockedUpdateTooltip(c);
321324
if (state === 'soft') {
322325
const soft = getPrimarySoftBlocker(c.updateEligibility);
323-
return soft ? `Manual update only — ${soft.message}` : 'Manual update only';
326+
return soft
327+
? t('containerComponents.groupedViews.manualUpdateOnlyWithMessage', { message: soft.message })
328+
: t('containerComponents.groupedViews.manualUpdateOnly');
324329
}
325330
return 'Update';
326331
}
@@ -772,7 +777,7 @@ onScopeDispose(() => {
772777
<span v-if="hasRegistryError(c)"
773778
class="inline-flex items-center justify-center"
774779
style="color: var(--dd-danger);"
775-
aria-label="Registry error"
780+
:aria-label="t('containerComponents.groupedViews.ariaRegistryError')"
776781
v-tooltip.top="tt(registryErrorTooltip(c))">
777782
<AppIcon name="warning" :size="12" />
778783
</span>
@@ -1321,28 +1326,28 @@ onScopeDispose(() => {
13211326
<span v-if="hasRegistryError(c)"
13221327
class="inline-flex items-center justify-center"
13231328
style="color: var(--dd-danger);"
1324-
aria-label="Registry error"
1329+
:aria-label="t('containerComponents.groupedViews.ariaRegistryError')"
13251330
v-tooltip.top="tt(registryErrorTooltip(c))">
13261331
<AppIcon name="warning" :size="12" />
13271332
</span>
13281333
<span v-if="getContainerListPolicyState(c).snoozed"
13291334
class="inline-flex items-center justify-center"
13301335
style="color: var(--dd-info);"
1331-
aria-label="Snoozed updates"
1336+
:aria-label="t('containerComponents.groupedViews.ariaSnoozedUpdates')"
13321337
v-tooltip.top="tt(containerPolicyTooltip(c, 'snoozed'))">
13331338
<AppIcon name="pause" :size="12" />
13341339
</span>
13351340
<span v-if="getContainerListPolicyState(c).skipped"
13361341
class="inline-flex items-center justify-center"
13371342
style="color: var(--dd-warning);"
1338-
aria-label="Skipped updates"
1343+
:aria-label="t('containerComponents.groupedViews.ariaSkippedUpdates')"
13391344
v-tooltip.top="tt(containerPolicyTooltip(c, 'skipped'))">
13401345
<AppIcon name="skip-forward" :size="12" />
13411346
</span>
13421347
<span v-if="getContainerListPolicyState(c).maturityBlocked"
13431348
class="inline-flex items-center justify-center"
13441349
style="color: var(--dd-primary);"
1345-
aria-label="Maturity-blocked updates"
1350+
:aria-label="t('containerComponents.groupedViews.ariaMaturityBlocked')"
13461351
v-tooltip.top="tt(containerPolicyTooltip(c, 'maturity'))">
13471352
<AppIcon name="clock" :size="12" />
13481353
</span>
@@ -1449,7 +1454,7 @@ onScopeDispose(() => {
14491454
<!-- EMPTY STATE -->
14501455
<EmptyState v-if="filteredContainers.length === 0"
14511456
icon="filter"
1452-
message="No containers match your filters"
1457+
:message="t('containerComponents.groupedViews.emptyState')"
14531458
:show-clear="activeFilterCount > 0 || !!filterSearch"
14541459
@clear="clearFilters" />
14551460
</div>

ui/src/locales/en/containerComponents.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@
187187
"registryErrorRateLimited": "Rate limited",
188188
"registryErrorAuth": "Auth failed",
189189
"registryErrorNotFound": "Not found",
190-
"registryErrorCheckFailed": "Check failed"
190+
"registryErrorCheckFailed": "Check failed",
191+
"blockedTag": "Blocked: {tag}",
192+
"blockedTagWithCriticals": "Blocked: {tag} ({count} critical CVE)",
193+
"blockedTagWithCriticalsCVEs": "Blocked: {tag} ({count} critical CVEs)",
194+
"manualUpdateOnly": "Manual update only",
195+
"manualUpdateOnlyWithMessage": "Manual update only — {message}"
191196
},
192197
"groupHeader": {
193198
"ungrouped": "Ungrouped",

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@
186186
"registryErrorRateLimited": "速率限制",
187187
"registryErrorAuth": "验证失败",
188188
"registryErrorNotFound": "未找到",
189-
"registryErrorCheckFailed": "检查失败"
189+
"registryErrorCheckFailed": "检查失败",
190+
"blockedTag": "已阻止:{tag}",
191+
"blockedTagWithCriticals": "已阻止:{tag}({count} 个严重)",
192+
"blockedTagWithCriticalsCVEs": "已阻止:{tag}({count} 个严重)",
193+
"manualUpdateOnly": "仅支持手动更新",
194+
"manualUpdateOnlyWithMessage": "仅支持手动更新 — {message}"
190195
},
191196
"groupHeader": {
192197
"ungrouped": "未分组",

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@
186186
"registryErrorRateLimited": "速率限制",
187187
"registryErrorAuth": "認證失敗",
188188
"registryErrorNotFound": "未找到",
189-
"registryErrorCheckFailed": "檢查失敗"
189+
"registryErrorCheckFailed": "檢查失敗",
190+
"blockedTag": "已封鎖:{tag}",
191+
"blockedTagWithCriticals": "已封鎖:{tag}({count} 個嚴重)",
192+
"blockedTagWithCriticalsCVEs": "已封鎖:{tag}({count} 個嚴重)",
193+
"manualUpdateOnly": "僅支援手動更新",
194+
"manualUpdateOnlyWithMessage": "僅支援手動更新 — {message}"
190195
},
191196
"groupHeader": {
192197
"ungrouped": "未分組",

0 commit comments

Comments
 (0)