File tree Expand file tree Collapse file tree
content-script/selection-tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454 "Summarize Page" : " Summarize Page" ,
5555 "Translate" : " Translate" ,
5656 "Translate (Bidirectional)" : " Translate (Bidirectional)" ,
57+ "Translate (To English)" : " Translate (To English)" ,
5758 "Summary" : " Summary" ,
5859 "Polish" : " Polish" ,
5960 "Sentiment Analysis" : " Sentiment Analysis" ,
Original file line number Diff line number Diff line change 5454 "Summarize Page" : " 总结本页" ,
5555 "Translate" : " 翻译" ,
5656 "Translate (Bidirectional)" : " 双向翻译" ,
57+ "Translate (To English)" : " 翻译为英语" ,
5758 "Summary" : " 总结" ,
5859 "Polish" : " 润色" ,
5960 "Sentiment Analysis" : " 情感分析" ,
Original file line number Diff line number Diff line change 5454 "Summarize Page" : " 摘要本頁" ,
5555 "Translate" : " 翻譯" ,
5656 "Translate (Bidirectional)" : " 雙向翻譯" ,
57+ "Translate (To English)" : " 翻譯為英語" ,
5758 "Summary" : " 摘要" ,
5859 "Polish" : " 潤色" ,
5960 "Sentiment Analysis" : " 情感分析" ,
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ export const defaultConfig = {
134134 userLanguage : getNavigatorLanguage ( ) ,
135135 selectionTools : [
136136 'translate' ,
137+ 'translateToEn' ,
137138 'translateBidi' ,
138139 'summary' ,
139140 'polish' ,
@@ -144,6 +145,7 @@ export const defaultConfig = {
144145 ] ,
145146 selectionToolsDesc : [
146147 'Translate' ,
148+ 'Translate (To English)' ,
147149 'Translate (Bidirectional)' ,
148150 'Summary' ,
149151 'Polish' ,
Original file line number Diff line number Diff line change @@ -16,7 +16,14 @@ export const config = {
1616 label : 'Translate' ,
1717 genPrompt : async ( selection ) => {
1818 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 } `
2027 } ,
2128 } ,
2229 translateBidi : {
@@ -27,7 +34,7 @@ export const config = {
2734 return (
2835 `Translate the following into ${ preferredLanguage } and only show me the translated content.` +
2936 `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 } `
3138 )
3239 } ,
3340 } ,
You can’t perform that action at this time.
0 commit comments