fix: copy i18n

This commit is contained in:
chansee97 2024-12-24 10:45:44 +08:00
parent aa9aece0ca
commit 5975d05437
3 changed files with 8 additions and 4 deletions

View File

@ -155,7 +155,9 @@
}, },
"copyText": { "copyText": {
"message": "Copied successfully", "message": "Copied successfully",
"tooltip": "Copy" "tooltip": "Copy",
"unsupportedError": "Your browser does not support Clipboard API",
"unpermittedError": "Crrently not permitted to use Clipboard API"
} }
} }
} }

View File

@ -87,7 +87,9 @@
}, },
"copyText": { "copyText": {
"tooltip": "复制", "tooltip": "复制",
"message": "复制成功" "message": "复制成功",
"unsupportedError": "您的浏览器不支持剪贴板API",
"unpermittedError": "目前不允许使用剪贴板API"
} }
}, },
"login": { "login": {

View File

@ -11,12 +11,12 @@ export function install(app: App) {
function clipboardEnable() { function clipboardEnable() {
if (!isSupported.value) { if (!isSupported.value) {
window.$message.error('Your browser does not support Clipboard API') window.$message.error($t('components.copyText.unsupportedError'))
return false return false
} }
if (permissionWrite.value !== 'granted') { if (permissionWrite.value !== 'granted') {
window.$message.error('Currently not permitted to use Clipboard API') window.$message.error($t('components.copyText.unpermittedError'))
return false return false
} }
return true return true