File tree 4 files changed +22
-11
lines changed
services/recognize/volcengine_multi_lang
Translate/components/TargetArea
4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { recognize } from './index';
11
11
import { Language } from './index' ;
12
12
13
13
export function Config ( props ) {
14
- const { instanceKeyupdateServiceList , onClose } = props ;
14
+ const { instanceKey , updateServiceList , onClose } = props ;
15
15
const { t } = useTranslation ( ) ;
16
16
const [ config , setConfig ] = useConfig (
17
17
instanceKey ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ export enum ServiceType {
2
2
TRANSLATE = 'translate' ,
3
3
RECOGNIZE = 'recognize' ,
4
4
TTS = 'tts' ,
5
- COLLECTION = 'Collection ' ,
5
+ COLLECTION = 'collection ' ,
6
6
}
7
7
8
8
export enum ServiceSourceType {
Original file line number Diff line number Diff line change @@ -239,15 +239,18 @@ export default function History() {
239
239
< >
240
240
< ModalHeader >
241
241
< div className = 'flex justify-start' >
242
- { selectedItem . service . startsWith ( 'plugin' ) ? (
242
+ { getServiceSouceType ( selectedItem . service ) === ServiceSourceType . PLUGIN ? (
243
243
< img
244
- src = { pluginList [ 'translate' ] [ selectedItem . service ] . icon }
244
+ src = {
245
+ pluginList [ 'translate' ] [ getServiceName ( selectedItem . service ) ]
246
+ . icon
247
+ }
245
248
className = 'h-[24px] w-[24px] my-auto'
246
249
draggable = { false }
247
250
/>
248
251
) : (
249
252
< img
250
- src = { `${ builtinServices [ selectedItem . service ] . info . icon } ` }
253
+ src = { `${ builtinServices [ getServiceName ( selectedItem . service ) ] . info . icon } ` }
251
254
className = 'h-[24px] w-[24px] m-auto mr-[8px]'
252
255
draggable = { false }
253
256
/>
@@ -350,10 +353,14 @@ export default function History() {
350
353
>
351
354
< img
352
355
src = {
353
- serviceName . startsWith ( 'plugin' )
354
- ? pluginList [ 'collection' ] [ serviceName ] . icon
355
- : builtinCollectionServices [ serviceName ] . info
356
- . icon
356
+ getServiceSouceType ( instanceKey ) ===
357
+ ServiceSourceType . PLUGIN
358
+ ? pluginList [ 'collection' ] [
359
+ getServiceName ( instanceKey )
360
+ ] . icon
361
+ : builtinCollectionServices [
362
+ getServiceName ( instanceKey )
363
+ ] . info . icon
357
364
}
358
365
className = 'h-[24px] w-[24px]'
359
366
/>
Original file line number Diff line number Diff line change @@ -826,8 +826,12 @@ export default function TargetArea(props) {
826
826
} else {
827
827
const instanceConfig =
828
828
serviceInstanceConfigMap [ collectionServiceInstanceName ] ;
829
- builtinCollectionServices [ collectionServiceInstanceName ]
830
- . collection ( sourceText , result )
829
+ builtinCollectionServices [
830
+ getServiceName ( collectionServiceInstanceName )
831
+ ]
832
+ . collection ( sourceText , result , {
833
+ config : instanceConfig ,
834
+ } )
831
835
. then (
832
836
( _ ) => {
833
837
toast . success ( t ( 'translate.add_collection_success' ) , {
You can’t perform that action at this time.
0 commit comments