Skip to content

Commit 16211f2

Browse files
committed
fix: add missing i18n strings for like button
1 parent 5bc0778 commit 16211f2

File tree

4 files changed

+45
-18
lines changed

4 files changed

+45
-18
lines changed

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

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -600,23 +600,35 @@ onKeyStroke(
600600
/>
601601

602602
<!-- Package likes -->
603-
<button
604-
@click="likeAction"
605-
type="button"
606-
class="inline-flex items-center gap-1.5 font-mono text-sm text-fg hover:text-fg-muted transition-colors duration-200"
607-
:title="$t('package.links.like')"
603+
<TooltipApp
604+
:text="
605+
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
606+
"
607+
position="bottom"
608608
>
609-
<span
610-
:class="
611-
likesData?.userHasLiked
612-
? 'i-lucide-heart-minus text-red-500'
613-
: 'i-lucide-heart-plus'
609+
<button
610+
@click="likeAction"
611+
type="button"
612+
:title="$t('package.likes.like')"
613+
class="inline-flex items-center gap-1.5 font-mono text-sm text-fg hover:text-fg-muted transition-colors duration-200"
614+
:aria-label="
615+
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
614616
"
615-
class="w-4 h-4"
616-
aria-hidden="true"
617-
/>
618-
<span>{{ formatCompactNumber(likesData?.totalLikes ?? 0, { decimals: 1 }) }}</span>
619-
</button>
617+
>
618+
<span
619+
:class="
620+
likesData?.userHasLiked
621+
? 'i-lucide-heart-minus text-red-500'
622+
: 'i-lucide-heart-plus'
623+
"
624+
class="w-4 h-4"
625+
aria-hidden="true"
626+
/>
627+
<span>{{
628+
formatCompactNumber(likesData?.totalLikes ?? 0, { decimals: 1 })
629+
}}</span>
630+
</button>
631+
</TooltipApp>
620632
<template #fallback>
621633
<div
622634
class="flex items-center gap-1.5 list-none m-0 p-0 relative top-[5px] self-baseline ms-1 sm:ms-2"

i18n/locales/en.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,12 @@
183183
"code": "code",
184184
"docs": "docs",
185185
"fund": "fund",
186-
"compare": "compare"
186+
"compare": "compare",
187+
"like": "like"
188+
},
189+
"likes": {
190+
"like": "Like this package",
191+
"unlike": "Unlike this package"
187192
},
188193
"docs": {
189194
"not_available": "Docs not available",

lunaria/files/en-GB.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,12 @@
183183
"code": "code",
184184
"docs": "docs",
185185
"fund": "fund",
186-
"compare": "compare"
186+
"compare": "compare",
187+
"like": "like"
188+
},
189+
"likes": {
190+
"like": "Like this package",
191+
"unlike": "Unlike this package"
187192
},
188193
"docs": {
189194
"not_available": "Docs not available",

lunaria/files/en-US.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,12 @@
183183
"code": "code",
184184
"docs": "docs",
185185
"fund": "fund",
186-
"compare": "compare"
186+
"compare": "compare",
187+
"like": "like"
188+
},
189+
"likes": {
190+
"like": "Like this package",
191+
"unlike": "Unlike this package"
187192
},
188193
"docs": {
189194
"not_available": "Docs not available",

0 commit comments

Comments
 (0)