File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
content-script/selection-tools Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export const defaultConfig = {
71
71
72
72
// others
73
73
74
- activeSelectionTools : Object . keys ( toolsConfig ) ,
74
+ activeSelectionTools : Object . keys ( toolsConfig ) . filter ( ( i ) => i !== 'translateBidi' ) ,
75
75
activeSiteAdapters : [
76
76
'bilibili' ,
77
77
'github' ,
Original file line number Diff line number Diff line change @@ -6,13 +6,22 @@ import {
6
6
QuestionCircle ,
7
7
Translate ,
8
8
Braces ,
9
+ Globe ,
9
10
} from 'react-bootstrap-icons'
10
11
import { getPreferredLanguage } from '../../config.mjs'
11
12
12
13
export const config = {
13
14
translate : {
14
15
icon : < Translate /> ,
15
16
label : 'Translate' ,
17
+ genPrompt : async ( selection ) => {
18
+ const preferredLanguage = await getPreferredLanguage ( )
19
+ return `Translate the following into ${ preferredLanguage } and only show me the translated content:\n"${ selection } "`
20
+ } ,
21
+ } ,
22
+ translateBidi : {
23
+ icon : < Globe /> ,
24
+ label : 'Translate (Bidirectional)' ,
16
25
genPrompt : async ( selection ) => {
17
26
const preferredLanguage = await getPreferredLanguage ( )
18
27
return (
You can’t perform that action at this time.
0 commit comments