diff --git a/contents/copycode.tsx b/contents/copycode.tsx index 9650050..15fb582 100644 --- a/contents/copycode.tsx +++ b/contents/copycode.tsx @@ -13,11 +13,15 @@ import type { FC } from "react" import { useStorage } from "@plasmohq/storage/dist/hook" +import { i18n } from "~tools" + export const config: PlasmoCSConfig = { matches: [ "https://*.npmjs.com/*", "https://*.medium.com/*", - "https://mp.weixin.qq.com/*" + "https://mp.weixin.qq.com/*", + "https://day.js.org/*", + "https://stackoverflow.com/*" ] } @@ -101,7 +105,7 @@ const PlasmoOverlay: FC = ({ anchor }) => { variant="filled" onClick={onCopy} className="codebox-copyCodeBtn"> - {isCopy ? "复制成功" : "复制"} + {isCopy ? i18n("copied") : i18n("copy")} ) : ( diff --git a/locales/en/messages.json b/locales/en/messages.json index a6984a4..c96aa9c 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -146,6 +146,12 @@ "copyCode": { "message": "Copy Code" }, + "copy": { + "message": "copy" + }, + "copied": { + "message": "copied" + }, "showTag": { "message": "Show Tag" }, diff --git a/locales/zh_CN/messages.json b/locales/zh_CN/messages.json index 50165ee..99b00da 100644 --- a/locales/zh_CN/messages.json +++ b/locales/zh_CN/messages.json @@ -146,6 +146,12 @@ "copyCode": { "message": "一键复制代码" }, + "copy": { + "message": "复制" + }, + "copied": { + "message": "复制成功" + }, "showTag": { "message": "显示标签" }, diff --git a/package.json b/package.json index 1bc31f8..ca11ae8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-box", "displayName": "__MSG_extensionName__", - "version": "0.9.8", + "version": "0.9.9", "description": "__MSG_extensionDescription__", "author": "027xiguapi. <458813868@qq.com>", "scripts": {