From 68f6d51ad213f93c3648bb2e5740766bb99b2342 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Thu, 6 Feb 2025 15:34:15 -0500 Subject: [PATCH] [i18n] Translate clipboard toast messages (#2462) Co-authored-by: github-actions --- src/composables/useCopyToClipboard.ts | 14 ++++++++------ src/locales/en/main.json | 5 +++++ src/locales/fr/main.json | 5 +++++ src/locales/ja/main.json | 5 +++++ src/locales/ko/main.json | 5 +++++ src/locales/ru/main.json | 5 +++++ src/locales/zh/main.json | 5 +++++ 7 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/composables/useCopyToClipboard.ts b/src/composables/useCopyToClipboard.ts index c2d06b325b..f780028e4a 100644 --- a/src/composables/useCopyToClipboard.ts +++ b/src/composables/useCopyToClipboard.ts @@ -1,6 +1,8 @@ import { useClipboard } from '@vueuse/core' import { useToast } from 'primevue/usetoast' +import { t } from '@/i18n' + export function useCopyToClipboard() { const { copy, isSupported } = useClipboard() const toast = useToast() @@ -11,22 +13,22 @@ export function useCopyToClipboard() { await copy(text) toast.add({ severity: 'success', - summary: 'Success', - detail: 'Copied to clipboard', + summary: t('g.success'), + detail: t('clipboard.successMessage'), life: 3000 }) } catch (err) { toast.add({ severity: 'error', - summary: 'Error', - detail: 'Failed to copy report' + summary: t('g.error'), + detail: t('clipboard.errorMessage') }) } } else { toast.add({ severity: 'error', - summary: 'Error', - detail: 'Clipboard API not supported in your browser' + summary: t('g.error'), + detail: t('clipboard.errorNotSupported') }) } } diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 3b144913cf..13d590cc7b 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -764,5 +764,10 @@ "title": "Updating ComfyUI Desktop", "description": "ComfyUI Desktop is installing new dependencies. This may take a few minutes.", "terminalDefaultMessage": "Any console output from the update will be shown here." + }, + "clipboard": { + "successMessage": "Copied to clipboard", + "errorMessage": "Failed to copy to clipboard", + "errorNotSupported": "Clipboard API not supported in your browser" } } \ No newline at end of file diff --git a/src/locales/fr/main.json b/src/locales/fr/main.json index 06b97fbb9f..c27ac44dca 100644 --- a/src/locales/fr/main.json +++ b/src/locales/fr/main.json @@ -1,4 +1,9 @@ { + "clipboard": { + "errorMessage": "Échec de la copie dans le presse-papiers", + "errorNotSupported": "L'API du presse-papiers n'est pas prise en charge par votre navigateur", + "successMessage": "Copié dans le presse-papiers" + }, "color": { "blue": "Bleu", "custom": "Personnalisé", diff --git a/src/locales/ja/main.json b/src/locales/ja/main.json index 7a988411da..9c59328ac0 100644 --- a/src/locales/ja/main.json +++ b/src/locales/ja/main.json @@ -1,4 +1,9 @@ { + "clipboard": { + "errorMessage": "クリップボードへのコピーに失敗しました", + "errorNotSupported": "お使いのブラウザではクリップボードAPIがサポートされていません", + "successMessage": "クリップボードにコピーしました" + }, "color": { "blue": "青", "custom": "カスタム", diff --git a/src/locales/ko/main.json b/src/locales/ko/main.json index b3ffc8a3d4..9561338e8f 100644 --- a/src/locales/ko/main.json +++ b/src/locales/ko/main.json @@ -1,4 +1,9 @@ { + "clipboard": { + "errorMessage": "클립보드에 복사하지 못했습니다", + "errorNotSupported": "당신의 브라우저에서 클립보드 API가 지원되지 않습니다", + "successMessage": "클립보드에 복사됨" + }, "color": { "blue": "파란색", "custom": "사용자 정의", diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index 9d2f9ab666..e823ad7a95 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -1,4 +1,9 @@ { + "clipboard": { + "errorMessage": "Не удалось скопировать в буфер обмена", + "errorNotSupported": "API буфера обмена не поддерживается в вашем браузере", + "successMessage": "Скопировано в буфер обмена" + }, "color": { "blue": "Синий", "custom": "Пользовательский", diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index dde617ba06..056ca76a35 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -1,4 +1,9 @@ { + "clipboard": { + "errorMessage": "复制到剪贴板失败", + "errorNotSupported": "您的浏览器不支持剪贴板API", + "successMessage": "已复制到剪贴板" + }, "color": { "blue": "蓝色", "custom": "自定义",