Add bergamotTranslate import onhtml translation too
This commit is contained in:
@@ -287,6 +287,12 @@ export async function translateHTML(html: string, reverse:boolean, charArg:simpl
|
|||||||
if(db.translatorType == "bergamot" && db.htmlTranslation) {
|
if(db.translatorType == "bergamot" && db.htmlTranslation) {
|
||||||
const from = db.aiModel.startsWith('novellist') ? 'ja' : 'en'
|
const from = db.aiModel.startsWith('novellist') ? 'ja' : 'en'
|
||||||
const to = db.translator || 'en'
|
const to = db.translator || 'en'
|
||||||
|
|
||||||
|
if(!bergamotTranslate){
|
||||||
|
const bergamotTranslator = await import('./bergamotTranslator')
|
||||||
|
bergamotTranslate = bergamotTranslator.bergamotTranslate
|
||||||
|
}
|
||||||
|
|
||||||
return bergamotTranslate(html, from, to, true)
|
return bergamotTranslate(html, from, to, true)
|
||||||
}
|
}
|
||||||
const dom = new DOMParser().parseFromString(html, 'text/html');
|
const dom = new DOMParser().parseFromString(html, 'text/html');
|
||||||
|
|||||||
Reference in New Issue
Block a user