add translations

This commit is contained in:
padreug 2025-02-12 00:08:33 +01:00
parent f3eb1622eb
commit e94e20db08
3 changed files with 32 additions and 8 deletions

View file

@ -4,7 +4,9 @@ import { useNostrStore } from '@/stores/nostr'
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog'
import { Button } from '@/components/ui/button'
import { LogOut, Copy, Check, ShieldAlert } from 'lucide-vue-next'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const props = defineProps<{
onLogout: () => void
}>()
@ -38,7 +40,7 @@ const handleLogout = () => {
<DialogTrigger as-child>
<Button variant="ghost" size="icon" class="text-muted-foreground hover:text-foreground">
<LogOut class="h-5 w-5" />
<span class="sr-only">Logout</span>
<span class="sr-only">{{ t('nav.logout') }}</span>
</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-md">
@ -50,11 +52,10 @@ const handleLogout = () => {
</div>
<div class="text-center space-y-2">
<DialogTitle class="text-xl font-semibold text-foreground">
Backup Required
{{ t('auth.logout.title') }}
</DialogTitle>
<DialogDescription class="text-muted-foreground">
If you haven't saved your private key, you will permanently lose access to this chat history. Make sure to
copy and securely store your private key before logging out.
{{ t('auth.logout.description') }}
</DialogDescription>
</div>
</DialogHeader>
@ -63,16 +64,16 @@ const handleLogout = () => {
@click="copyPrivateKey">
<Copy v-if="!hasCopied" class="h-4 w-4 mr-2" />
<Check v-else class="h-4 w-4 mr-2" />
{{ hasCopied ? 'Copied!' : 'Copy Private Key' }}
{{ hasCopied ? t('auth.logout.copied') : t('auth.logout.copyKey') }}
</Button>
</div>
<DialogFooter class="flex flex-col sm:flex-row gap-2 sm:gap-3">
<Button variant="ghost" @click="() => isOpen = false" class="flex-1 sm:flex-none hover:bg-muted">
Cancel
{{ t('auth.logout.cancel') }}
</Button>
<Button variant="destructive" @click="handleLogout" class="flex-1 sm:flex-none">
<LogOut class="h-4 w-4 mr-2" />
Logout
{{ t('auth.logout.confirm') }}
</Button>
</DialogFooter>
</DialogContent>