Skip to content

Commit 6672c8e

Browse files
committed
fix: localise unpacked size tooltip
1 parent e8e6ad8 commit 6672c8e

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

app/pages/[...package].vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,15 @@ const sizeTooltip = computed(() => {
134134
const chunks = [
135135
displayVersion.value &&
136136
displayVersion.value.dist.unpackedSize &&
137-
`${formatBytes(displayVersion.value.dist.unpackedSize)} unpacked size (this package)`,
137+
$t('package.stats.size_tooltip.unpacked', {
138+
size: formatBytes(displayVersion.value.dist.unpackedSize),
139+
}),
138140
installSize.value &&
139141
installSize.value.dependencyCount &&
140-
`${formatBytes(installSize.value.totalSize)} total unpacked size (including all ${installSize.value.dependencyCount} dependencies for linux-x64)`,
142+
$t('package.stats.size_tooltip.total', {
143+
size: formatBytes(installSize.value.totalSize),
144+
count: installSize.value.dependencyCount,
145+
}),
141146
]
142147
return chunks.filter(Boolean).join('\n')
143148
})

i18n/locales/en.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@
132132
"vulns": "Vulns",
133133
"updated": "Updated",
134134
"view_dependency_graph": "View dependency graph",
135-
"inspect_dependency_tree": "Inspect dependency tree"
135+
"inspect_dependency_tree": "Inspect dependency tree",
136+
"size_tooltip": {
137+
"unpacked": "{size} unpacked size (this package)",
138+
"total": "{size} total unpacked size (including all {count} dependencies for linux-x64)"
139+
}
136140
},
137141
"links": {
138142
"repo": "repo",

0 commit comments

Comments
 (0)