diff --git a/locales/en_US.json b/locales/en_US.json index 6111b30..984e5d0 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -155,7 +155,9 @@ }, "copyText": { "message": "Copied successfully", - "tooltip": "Copy" + "tooltip": "Copy", + "unsupportedError": "Your browser does not support Clipboard API", + "unpermittedError": "Crrently not permitted to use Clipboard API" } } } diff --git a/locales/zh_CN.json b/locales/zh_CN.json index c049528..5b600b2 100644 --- a/locales/zh_CN.json +++ b/locales/zh_CN.json @@ -87,7 +87,9 @@ }, "copyText": { "tooltip": "复制", - "message": "复制成功" + "message": "复制成功", + "unsupportedError": "您的浏览器不支持剪贴板API", + "unpermittedError": "目前不允许使用剪贴板API" } }, "login": { diff --git a/src/directives/copy.ts b/src/directives/copy.ts index bfd529f..321bbb1 100644 --- a/src/directives/copy.ts +++ b/src/directives/copy.ts @@ -11,12 +11,12 @@ export function install(app: App) { function clipboardEnable() { if (!isSupported.value) { - window.$message.error('Your browser does not support Clipboard API') + window.$message.error($t('components.copyText.unsupportedError')) return false } if (permissionWrite.value !== 'granted') { - window.$message.error('Currently not permitted to use Clipboard API') + window.$message.error($t('components.copyText.unpermittedError')) return false } return true