Skip to content

Commit ad4f1c9

Browse files
committed
translateToZh (#342)
1 parent a0c19d7 commit ad4f1c9

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

src/_locales/en/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"Translate": "Translate",
5656
"Translate (Bidirectional)": "Translate (Bidirectional)",
5757
"Translate (To English)": "Translate (To English)",
58+
"Translate (To Chinese)": "Translate (To Chinese)",
5859
"Summary": "Summary",
5960
"Polish": "Polish",
6061
"Sentiment Analysis": "Sentiment Analysis",

src/_locales/zh-hans/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"Translate": "翻译",
5656
"Translate (Bidirectional)": "双向翻译",
5757
"Translate (To English)": "翻译为英语",
58+
"Translate (To Chinese)": "翻译为中文",
5859
"Summary": "总结",
5960
"Polish": "润色",
6061
"Sentiment Analysis": "情感分析",

src/_locales/zh-hant/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"Translate": "翻譯",
5656
"Translate (Bidirectional)": "雙向翻譯",
5757
"Translate (To English)": "翻譯為英文",
58+
"Translate (To Chinese)": "翻譯為中文",
5859
"Summary": "摘要",
5960
"Polish": "潤飾",
6061
"Sentiment Analysis": "情感分析",

src/config/index.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export const defaultConfig = {
187187
selectionTools: [
188188
'translate',
189189
'translateToEn',
190+
'translateToZh',
190191
'translateBidi',
191192
'summary',
192193
'polish',

src/content-script/selection-tools/index.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ export const config = {
2626
return `Translate the following into English and only show me the translated content:\n${selection}`
2727
},
2828
},
29+
translateToZh: {
30+
icon: <Globe />,
31+
label: 'Translate (To Chinese)',
32+
genPrompt: async (selection) => {
33+
return `Translate the following into Chinese and only show me the translated content:\n${selection}`
34+
},
35+
},
2936
translateBidi: {
3037
icon: <Globe />,
3138
label: 'Translate (Bidirectional)',

0 commit comments

Comments
 (0)