一键复制代码国际化

This commit is contained in:
fzk
2024-11-01 17:03:06 +08:00
parent e00bbe34a9
commit daca02a890
4 changed files with 19 additions and 3 deletions

View File

@@ -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<PlasmoCSUIProps> = ({ anchor }) => {
variant="filled"
onClick={onCopy}
className="codebox-copyCodeBtn">
{isCopy ? "复制成功" : "复制"}
{isCopy ? i18n("copied") : i18n("copy")}
</Button>
</div>
) : (

View File

@@ -146,6 +146,12 @@
"copyCode": {
"message": "Copy Code"
},
"copy": {
"message": "copy"
},
"copied": {
"message": "copied"
},
"showTag": {
"message": "Show Tag"
},

View File

@@ -146,6 +146,12 @@
"copyCode": {
"message": "一键复制代码"
},
"copy": {
"message": "复制"
},
"copied": {
"message": "复制成功"
},
"showTag": {
"message": "显示标签"
},

View File

@@ -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": {