mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-06-27 23:06:53 +08:00
feat: direct translation and bidi translation
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ export const defaultConfig = {
|
||||
|
||||
// others
|
||||
|
||||
activeSelectionTools: Object.keys(toolsConfig),
|
||||
activeSelectionTools: Object.keys(toolsConfig).filter((i) => i !== 'translateBidi'),
|
||||
activeSiteAdapters: [
|
||||
'bilibili',
|
||||
'github',
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
QuestionCircle,
|
||||
Translate,
|
||||
Braces,
|
||||
Globe,
|
||||
} from 'react-bootstrap-icons'
|
||||
import { getPreferredLanguage } from '../../config.mjs'
|
||||
|
||||
@@ -13,6 +14,14 @@ export const config = {
|
||||
translate: {
|
||||
icon: <Translate />,
|
||||
label: 'Translate',
|
||||
genPrompt: async (selection) => {
|
||||
const preferredLanguage = await getPreferredLanguage()
|
||||
return `Translate the following into ${preferredLanguage} and only show me the translated content:\n"${selection}"`
|
||||
},
|
||||
},
|
||||
translateBidi: {
|
||||
icon: <Globe />,
|
||||
label: 'Translate (Bidirectional)',
|
||||
genPrompt: async (selection) => {
|
||||
const preferredLanguage = await getPreferredLanguage()
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user