Skip to content

Commit 3a67356

Browse files
authored
fix(i18n): add missing i18n strings for like button + tooltip (#957)
1 parent bcfdd56 commit 3a67356

File tree

4 files changed

+41
-15
lines changed

4 files changed

+41
-15
lines changed

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

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -600,23 +600,37 @@ 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="
613+
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
614614
"
615-
class="w-4 h-4"
616-
aria-hidden="true"
617-
/>
618-
<span>{{ formatCompactNumber(likesData?.totalLikes ?? 0, { decimals: 1 }) }}</span>
619-
</button>
615+
class="inline-flex items-center gap-1.5 font-mono text-sm text-fg hover:text-fg-muted transition-colors duration-200"
616+
:aria-label="
617+
likesData?.userHasLiked ? $t('package.likes.unlike') : $t('package.likes.like')
618+
"
619+
>
620+
<span
621+
:class="
622+
likesData?.userHasLiked
623+
? 'i-lucide-heart-minus text-red-500'
624+
: 'i-lucide-heart-plus'
625+
"
626+
class="w-4 h-4"
627+
aria-hidden="true"
628+
/>
629+
<span>{{
630+
formatCompactNumber(likesData?.totalLikes ?? 0, { decimals: 1 })
631+
}}</span>
632+
</button>
633+
</TooltipApp>
620634
<template #fallback>
621635
<div
622636
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
"fund": "fund",
186186
"compare": "compare"
187187
},
188+
"likes": {
189+
"like": "Like this package",
190+
"unlike": "Unlike this package"
191+
},
188192
"docs": {
189193
"not_available": "Docs not available",
190194
"not_available_detail": "We could not generate docs for this version."

lunaria/files/en-GB.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
"fund": "fund",
186186
"compare": "compare"
187187
},
188+
"likes": {
189+
"like": "Like this package",
190+
"unlike": "Unlike this package"
191+
},
188192
"docs": {
189193
"not_available": "Docs not available",
190194
"not_available_detail": "We could not generate docs for this version."

lunaria/files/en-US.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
"fund": "fund",
186186
"compare": "compare"
187187
},
188+
"likes": {
189+
"like": "Like this package",
190+
"unlike": "Unlike this package"
191+
},
188192
"docs": {
189193
"not_available": "Docs not available",
190194
"not_available_detail": "We could not generate docs for this version."

0 commit comments

Comments
 (0)