Add some missing i18n keys and update Chinese translation

Add some missing i18n keys and update Chinese translation
This commit is contained in:
Karl Lee
2024-06-17 16:32:36 +08:00
parent a28ad06bf0
commit 720ff35edf
4 changed files with 30 additions and 22 deletions

View File

@@ -1,16 +1,17 @@
<script lang="ts">
import { onMount, createEventDispatcher } from 'svelte';
import { onMount, getContext, createEventDispatcher } from 'svelte';
import { fade } from 'svelte/transition';
const i18n = getContext('i18n');
import { flyAndScale } from '$lib/utils/transitions';
const dispatch = createEventDispatcher();
export let title = 'Confirm your action';
export let message = 'This action cannot be undone. Do you wish to continue?';
export let title = ($i18n.t('Confirm your action'));
export let message = ($i18n.t('This action cannot be undone. Do you wish to continue?'));
export let cancelLabel = 'Cancel';
export let confirmLabel = 'Confirm';
export let cancelLabel = ($i18n.t('Cancel'));
export let confirmLabel = ($i18n.t('Confirm'));
export let show = false;
let modalElement = null;

View File

@@ -195,13 +195,13 @@
<DeleteConfirmDialog
bind:show={showDeleteConfirm}
title="Delete chat?"
title={$i18n.t('Delete chat?')}
on:confirm={() => {
deleteChatHandler(deleteChat.id);
}}
>
<div class=" text-sm text-gray-500">
This will delete <span class=" font-semibold">{deleteChat.title}</span>.
{$i18n.t('This will delete')} <span class=" font-semibold">{deleteChat.title}</span>.
</div>
</DeleteConfirmDialog>

View File

@@ -138,7 +138,7 @@
>
{#if confirmEdit}
<div class="flex self-center space-x-1.5 z-10">
<Tooltip content="Confirm">
<Tooltip content={$i18n.t('Confirm')}>
<button
class=" self-center dark:hover:text-white transition"
on:click={() => {
@@ -162,7 +162,7 @@
</button>
</Tooltip>
<Tooltip content="Cancel">
<Tooltip content={$i18n.t('Cancel')}>
<button
class=" self-center dark:hover:text-white transition"
on:click={() => {
@@ -185,7 +185,7 @@
</div>
{:else if shiftKey && mouseOver}
<div class=" flex items-center self-center space-x-1.5">
<Tooltip content="Archive" className="flex items-center">
<Tooltip content={$i18n.t('Archive')} className="flex items-center">
<button
class=" self-center dark:hover:text-white transition"
on:click={() => {
@@ -197,7 +197,7 @@
</button>
</Tooltip>
<Tooltip content="Delete">
<Tooltip content={$i18n.t('Delete')}>
<button
class=" self-center dark:hover:text-white transition"
on:click={() => {