Skip to content

Commit f43e01b

Browse files
committed
fix: yet more keys!
1 parent e64aab5 commit f43e01b

8 files changed

Lines changed: 47 additions & 21 deletions

File tree

app/components/PackageDownloadStats.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script setup lang="ts">
22
import { VueUiSparkline } from 'vue-data-ui/vue-ui-sparkline'
33
4+
const { t } = useI18n()
5+
46
const props = defineProps<{
57
downloads?: Array<{
68
downloads: number | null
@@ -12,7 +14,7 @@ const props = defineProps<{
1214
const dataset = computed(() =>
1315
props.downloads?.map(d => ({
1416
value: d?.downloads ?? 0,
15-
period: `${d.weekStart ?? '-'} to ${d.weekEnd ?? '-'}`,
17+
period: t('package.downloads.date_range', { start: d.weekStart ?? '-', end: d.weekEnd ?? '-' }),
1618
})),
1719
)
1820

app/components/PackageVersions.vue

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
} from '~/utils/versions'
1111
import { fetchAllPackageVersions } from '~/composables/useNpmRegistry'
1212
13+
const { t } = useI18n()
14+
1315
const props = defineProps<{
1416
packageName: string
1517
versions: Record<string, PackumentVersion>
@@ -340,7 +342,9 @@ function getTagVersions(tag: string): VersionDisplay[] {
340342
"
341343
:title="
342344
row.primaryVersion.deprecated
343-
? `${row.primaryVersion.version} (deprecated)`
345+
? t('package.versions.deprecated_title', {
346+
version: row.primaryVersion.version,
347+
})
344348
: row.primaryVersion.version
345349
"
346350
>
@@ -391,7 +395,11 @@ function getTagVersions(tag: string): VersionDisplay[] {
391395
? 'text-red-400 hover:text-red-300'
392396
: 'text-fg-subtle hover:text-fg-muted'
393397
"
394-
:title="v.deprecated ? `${v.version} (deprecated)` : v.version"
398+
:title="
399+
v.deprecated
400+
? t('package.versions.deprecated_title', { version: v.version })
401+
: v.version
402+
"
395403
>
396404
{{ v.version }}
397405
</NuxtLink>
@@ -470,7 +478,9 @@ function getTagVersions(tag: string): VersionDisplay[] {
470478
"
471479
:title="
472480
row.primaryVersion.deprecated
473-
? `${row.primaryVersion.version} (deprecated)`
481+
? t('package.versions.deprecated_title', {
482+
version: row.primaryVersion.version,
483+
})
474484
: row.primaryVersion.version
475485
"
476486
>
@@ -556,7 +566,9 @@ function getTagVersions(tag: string): VersionDisplay[] {
556566
"
557567
:title="
558568
group.versions[0].deprecated
559-
? `${group.versions[0].version} (deprecated)`
569+
? t('package.versions.deprecated_title', {
570+
version: group.versions[0].version,
571+
})
560572
: group.versions[0].version
561573
"
562574
>
@@ -589,7 +601,11 @@ function getTagVersions(tag: string): VersionDisplay[] {
589601
? 'text-red-400 hover:text-red-300'
590602
: 'text-fg-subtle hover:text-fg-muted'
591603
"
592-
:title="v.deprecated ? `${v.version} (deprecated)` : v.version"
604+
:title="
605+
v.deprecated
606+
? t('package.versions.deprecated_title', { version: v.version })
607+
: v.version
608+
"
593609
>
594610
{{ v.version }}
595611
</NuxtLink>

app/pages/@[org].vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const { data: results, status, error } = await useOrgPackages(orgName)
4444
if (status.value === 'error' && error.value?.statusCode === 404) {
4545
throw createError({
4646
statusCode: 404,
47-
statusMessage: 'Organization not found',
48-
message: `The organization "@${orgName.value}" does not exist on npm`,
47+
statusMessage: t('org.page.not_found'),
48+
message: t('org.page.not_found_message', { name: orgName.value }),
4949
})
5050
}
5151
@@ -222,7 +222,7 @@ defineOgImageComponent('Default', {
222222
<PackageListControls
223223
v-model:filter="filterText"
224224
v-model:sort="sortOption"
225-
:placeholder="`Filter ${packageCount} packages...`"
225+
:placeholder="t('org.page.filter_placeholder', { count: packageCount })"
226226
:total-count="packageCount"
227227
:filtered-count="filteredCount"
228228
/>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ defineOgImageComponent('Package', {
433433
<NuxtLink
434434
v-if="resolvedVersion !== requestedVersion"
435435
:to="`/${pkg.name}/v/${displayVersion.version}`"
436-
title="View permalink for this version"
436+
:title="t('package.view_permalink')"
437437
>{{ displayVersion.version }}</NuxtLink
438438
>
439439
<span v-else>v{{ displayVersion.version }}</span>
@@ -444,7 +444,7 @@ defineOgImageComponent('Package', {
444444
target="_blank"
445445
rel="noopener noreferrer"
446446
class="inline-flex items-center justify-center gap-1.5 text-fg-muted hover:text-fg transition-colors duration-200 min-w-6 min-h-6"
447-
title="Verified provenance"
447+
:title="t('package.verified_provenance')"
448448
>
449449
<span
450450
class="i-solar-shield-check-outline w-3.5 h-3.5 shrink-0"
@@ -483,11 +483,11 @@ defineOgImageComponent('Package', {
483483
target="_blank"
484484
rel="noopener noreferrer"
485485
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5 ml-auto shrink-0 self-center"
486-
title="View on npm"
486+
:title="t('common.view_on_npm')"
487487
>
488488
<span class="i-carbon-logo-npm w-4 h-4" aria-hidden="true" />
489489
<span class="hidden sm:inline">npm</span>
490-
<span class="sr-only sm:hidden">View on npm</span>
490+
<span class="sr-only sm:hidden">{{ t('common.view_on_npm') }}</span>
491491
</a>
492492
</div>
493493

@@ -850,7 +850,7 @@ defineOgImageComponent('Package', {
850850
v-if="typesPackageName"
851851
:to="`/${typesPackageName}`"
852852
class="text-fg-subtle hover:text-fg-muted text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 rounded"
853-
title="View @types package"
853+
:title="t('package.install.view_types', { package: typesPackageName })"
854854
>
855855
<span class="i-carbon-arrow-right w-3 h-3" aria-hidden="true" />
856856
<span class="sr-only">View {{ typesPackageName }}</span>

app/pages/code/[...path].vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ useSeoMeta({
404404
class="sticky top-0 bg-bg border-b border-border px-4 py-2 flex items-center justify-between"
405405
>
406406
<div class="flex items-center gap-3 text-sm">
407-
<span class="text-fg-muted">{{ fileContent.lines }} lines</span>
407+
<span class="text-fg-muted">{{ t('code.lines', { count: fileContent.lines }) }}</span>
408408
<span v-if="currentNode?.size" class="text-fg-subtle">{{
409409
formatBytes(currentNode.size)
410410
}}</span>

app/pages/search.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ defineOgImageComponent('Default', {
399399
<div class="container pt-20 pb-6">
400400
<section v-if="query" aria-label="Search results" @keydown="handleResultsKeydown">
401401
<!-- Initial loading (only after user interaction, not during view transition) -->
402-
<LoadingSpinner v-if="showSearching" text="Searching…" />
402+
<LoadingSpinner v-if="showSearching" :text="t('search.searching')" />
403403

404404
<div v-else-if="visibleResults">
405405
<!-- Claim prompt - shown at top when valid name but no exact match -->

app/pages/~[username]/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ defineOgImageComponent('Default', {
239239
<PackageListControls
240240
v-model:filter="filterText"
241241
v-model:sort="sortOption"
242-
:placeholder="`Filter ${packageCount} packages...`"
242+
:placeholder="t('user.page.filter_placeholder', { count: packageCount })"
243243
:total-count="packageCount"
244244
:filtered-count="filteredCount"
245245
/>

i18n/locales/en.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"placeholder": "search packages...",
1919
"button": "search",
2020
"clear": "Clear search",
21+
"searching": "Searching...",
2122
"found_packages": "Found {count} packages",
2223
"updating": "(updating...)",
2324
"no_results": "No packages found for \"{query}\"",
@@ -117,7 +118,8 @@
117118
"expand": "Expand {tag}",
118119
"other_versions": "Other versions",
119120
"more_tagged": "{count} more tagged",
120-
"all_covered": "All versions are covered by tags above"
121+
"all_covered": "All versions are covered by tags above",
122+
"deprecated_title": "{version} (deprecated)"
121123
},
122124
"dependencies": {
123125
"title": "Dependencies ({count})",
@@ -148,7 +150,8 @@
148150
"add_owner": "+ Add owner"
149151
},
150152
"downloads": {
151-
"title": "Weekly Downloads"
153+
"title": "Weekly Downloads",
154+
"date_range": "{start} to {end}"
152155
},
153156
"install_scripts": {
154157
"title": "Install Scripts",
@@ -354,7 +357,10 @@
354357
"no_packages": "No public packages found for",
355358
"no_packages_hint": "This organization may not exist or has no public packages.",
356359
"failed_to_load": "Failed to load organization packages",
357-
"no_match": "No packages match \"{query}\""
360+
"no_match": "No packages match \"{query}\"",
361+
"not_found": "Organization not found",
362+
"not_found_message": "The organization \"{'@'}{name}\" does not exist on npm",
363+
"filter_placeholder": "Filter {count} packages..."
358364
}
359365
},
360366
"user": {
@@ -369,7 +375,8 @@
369375
"no_packages": "No public packages found for",
370376
"no_packages_hint": "This user may not exist or has no public packages.",
371377
"failed_to_load": "Failed to load user packages",
372-
"no_match": "No packages match \"{query}\""
378+
"no_match": "No packages match \"{query}\"",
379+
"filter_placeholder": "Filter {count} packages..."
373380
}
374381
},
375382
"claim": {
@@ -405,6 +412,7 @@
405412
"no_files": "No files in this directory",
406413
"select_version": "Select version",
407414
"root": "root",
415+
"lines": "{count} lines",
408416
"toggle_tree": "Toggle file tree",
409417
"close_tree": "Close file tree",
410418
"copy_link": "Copy link",

0 commit comments

Comments
 (0)