Skip to content

Commit 950e585

Browse files
committed
fix: prefer $t
1 parent 1e0fecd commit 950e585

1 file changed

Lines changed: 7 additions & 16 deletions

File tree

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

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
import type { NpmVersionDist, PackumentVersion, ReadmeResponse } from '#shared/types'
33
import type { JsrPackageInfo } from '#shared/types/jsr'
44
import { assertValidPackageName } from '#shared/utils/npm'
5-
import {
6-
getExecutableInfo,
7-
getRunCommandParts,
8-
getRunCommand,
9-
isBinaryOnlyPackage,
10-
isCreatePackage,
11-
} from '~/utils/run-command'
12-
import { getExecuteCommandParts, getExecuteCommand } from '~/utils/install-command'
135
import { onKeyStroke } from '@vueuse/core'
146
import { joinURL } from 'ufo'
157
import { areUrlsEquivalent } from '#shared/utils/url'
@@ -22,7 +14,6 @@ definePageMeta({
2214
const router = useRouter()
2315
2416
const { packageName, requestedVersion, orgName } = usePackageRoute()
25-
const { t } = useI18n()
2617
2718
if (import.meta.server) {
2819
assertValidPackageName(packageName.value)
@@ -943,11 +934,11 @@ defineOgImageComponent('Package', {
943934
<button
944935
type="button"
945936
class="px-2 py-0.5 font-mono text-xs text-fg-muted bg-bg-subtle/80 border border-border rounded transition-colors duration-200 opacity-0 group-hover/installcmd:opacity-100 hover:(text-fg border-border-hover) active:scale-95 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
946-
:aria-label="t('package.install.copy_command')"
937+
:aria-label="$t('package.install.copy_command')"
947938
@click.stop="copyInstallCommand"
948939
>
949940
<span aria-live="polite">{{
950-
copied ? t('common.copied') : t('common.copy')
941+
copied ? $t('common.copied') : $t('common.copy')
951942
}}</span>
952943
</button>
953944
</div>
@@ -979,7 +970,7 @@ defineOgImageComponent('Package', {
979970
<!-- Comment line -->
980971
<div class="flex items-center gap-2 pt-1">
981972
<span class="text-fg-subtle/50 font-mono text-sm select-none"
982-
># {{ t('package.run.locally') }}</span
973+
># {{ $t('package.run.locally') }}</span
983974
>
984975
</div>
985976

@@ -1006,7 +997,7 @@ defineOgImageComponent('Package', {
1006997
class="px-2 py-0.5 font-mono text-xs text-fg-muted bg-bg-subtle/80 border border-border rounded transition-colors duration-200 opacity-0 group-hover/runcmd:opacity-100 hover:(text-fg border-border-hover) active:scale-95 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
1007998
@click.stop="copyRunCommand(executableInfo?.primaryCommand)"
1008999
>
1009-
{{ runCopied ? t('common.copied') : t('common.copy') }}
1000+
{{ runCopied ? $t('common.copied') : $t('common.copy') }}
10101001
</button>
10111002
</div>
10121003
</template>
@@ -1016,7 +1007,7 @@ defineOgImageComponent('Package', {
10161007
<!-- Comment line -->
10171008
<div class="flex items-center gap-2 pt-1">
10181009
<span class="text-fg-subtle/50 font-mono text-sm select-none"
1019-
># {{ t('package.create.title') }}</span
1010+
># {{ $t('package.create.title') }}</span
10201011
>
10211012
</div>
10221013

@@ -1041,11 +1032,11 @@ defineOgImageComponent('Package', {
10411032
<button
10421033
type="button"
10431034
class="px-2 py-0.5 font-mono text-xs text-fg-muted bg-bg-subtle/80 border border-border rounded transition-colors duration-200 opacity-0 group-hover/createcmd:opacity-100 hover:(text-fg border-border-hover) active:scale-95 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
1044-
:aria-label="t('package.create.copy_command')"
1035+
:aria-label="$t('package.create.copy_command')"
10451036
@click.stop="copyCreateCommand"
10461037
>
10471038
<span aria-live="polite">{{
1048-
createCopied ? t('common.copied') : t('common.copy')
1039+
createCopied ? $t('common.copied') : $t('common.copy')
10491040
}}</span>
10501041
</button>
10511042
<NuxtLink

0 commit comments

Comments
 (0)