File tree Expand file tree Collapse file tree 5 files changed +14
-2
lines changed
content-script/selection-tools Expand file tree Collapse file tree 5 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 54
54
"Summarize Page" : " Summarize Page" ,
55
55
"Translate" : " Translate" ,
56
56
"Translate (Bidirectional)" : " Translate (Bidirectional)" ,
57
+ "Translate (To English)" : " Translate (To English)" ,
57
58
"Summary" : " Summary" ,
58
59
"Polish" : " Polish" ,
59
60
"Sentiment Analysis" : " Sentiment Analysis" ,
Original file line number Diff line number Diff line change 54
54
"Summarize Page" : " 总结本页" ,
55
55
"Translate" : " 翻译" ,
56
56
"Translate (Bidirectional)" : " 双向翻译" ,
57
+ "Translate (To English)" : " 翻译为英语" ,
57
58
"Summary" : " 总结" ,
58
59
"Polish" : " 润色" ,
59
60
"Sentiment Analysis" : " 情感分析" ,
Original file line number Diff line number Diff line change 54
54
"Summarize Page" : " 摘要本頁" ,
55
55
"Translate" : " 翻譯" ,
56
56
"Translate (Bidirectional)" : " 雙向翻譯" ,
57
+ "Translate (To English)" : " 翻譯為英語" ,
57
58
"Summary" : " 摘要" ,
58
59
"Polish" : " 潤色" ,
59
60
"Sentiment Analysis" : " 情感分析" ,
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ export const defaultConfig = {
134
134
userLanguage : getNavigatorLanguage ( ) ,
135
135
selectionTools : [
136
136
'translate' ,
137
+ 'translateToEn' ,
137
138
'translateBidi' ,
138
139
'summary' ,
139
140
'polish' ,
@@ -144,6 +145,7 @@ export const defaultConfig = {
144
145
] ,
145
146
selectionToolsDesc : [
146
147
'Translate' ,
148
+ 'Translate (To English)' ,
147
149
'Translate (Bidirectional)' ,
148
150
'Summary' ,
149
151
'Polish' ,
Original file line number Diff line number Diff line change @@ -16,7 +16,14 @@ export const config = {
16
16
label : 'Translate' ,
17
17
genPrompt : async ( selection ) => {
18
18
const preferredLanguage = await getPreferredLanguage ( )
19
- return `Translate the following into ${ preferredLanguage } and only show me the translated content:\n"${ selection } "`
19
+ return `Translate the following into ${ preferredLanguage } and only show me the translated content:\n${ selection } `
20
+ } ,
21
+ } ,
22
+ translateToEn : {
23
+ icon : < Globe /> ,
24
+ label : 'Translate (To English)' ,
25
+ genPrompt : async ( selection ) => {
26
+ return `Translate the following into English and only show me the translated content:\n${ selection } `
20
27
} ,
21
28
} ,
22
29
translateBidi : {
@@ -27,7 +34,7 @@ export const config = {
27
34
return (
28
35
`Translate the following into ${ preferredLanguage } and only show me the translated content.` +
29
36
`If it is already in ${ preferredLanguage } ,` +
30
- `translate it into English and only show me the translated content:\n" ${ selection } " `
37
+ `translate it into English and only show me the translated content:\n${ selection } `
31
38
)
32
39
} ,
33
40
} ,
You can’t perform that action at this time.
0 commit comments