Skip to content

Commit

Permalink
feat: update lang
Browse files Browse the repository at this point in the history
  • Loading branch information
smackgg committed Apr 12, 2023
1 parent a212420 commit 23f59a4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/common/components/handle-result-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useState } from "react"

import { insertMainSelectionChar, replaceMainSelectionChar } from "~lib/docs"
import { HandleResultEnum, HandleResultMap, ISelectionOption } from "~lib/enums"
import { useLang } from "~lib/hooks/useLang"
import { showToast } from "~lib/toast"

import Toast from "./toast"
Expand Down Expand Up @@ -35,6 +36,8 @@ export default function HandleResultMenu(props: IHandleResultMenu) {
}
}

const { t } = useLang()

return (
<>
<div className="dropdown dropdown-hover absolute right-0 top-0 p-2">
Expand Down Expand Up @@ -65,7 +68,9 @@ export default function HandleResultMenu(props: IHandleResultMenu) {
{option.icon && (
<option.icon className="h-4 w-4 flex-none rounded-full text-violet-300" />
)}
<span className="ml-3 flex-auto truncate ">{option.label}</span>
<span className="ml-3 flex-auto truncate ">
{t(option.label)}
</span>
{active && (
<ArrowUturnLeftIcon
className="ml-3 h-4 w-4 flex-none text-gray-400"
Expand Down
5 changes: 4 additions & 1 deletion src/lib/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@
"Write a sales email about ": "Write a sales email about ",
"Write a recruiting email about ": "Write a recruiting email about ",
"No Selection Text": "No Selection Text",
"Write selection text": "Write selection text"
"Write selection text": "Write selection text",
"Replace selection": "Replace selection",
"Insert below": "Insert below",
"Copy": "Copy"
}
5 changes: 4 additions & 1 deletion src/lib/locales/zh/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,8 @@
"Write a sales email about ": "写销售邮件关于:",
"Write a recruiting email about ": "写招聘邮件关于:",
"No Selection Text": "没有选择文本",
"Write selection text": "写入选区文本"
"Write selection text": "写入选区文本",
"Replace selection": "替换选区",
"Insert below": "插入到下面",
"Copy": "复制"
}

0 comments on commit 23f59a4

Please sign in to comment.