Merge branch 'main' of https://github.com/kwaroran/RisuAI
This commit is contained in:
@@ -140,11 +140,12 @@
|
|||||||
translateText = false
|
translateText = false
|
||||||
try {
|
try {
|
||||||
if(DBState.db.autoTranslate){
|
if(DBState.db.autoTranslate){
|
||||||
if(DBState.db.autoTranslateCachedOnly && DBState.db.translatorType === "llm"){
|
if(DBState.db.autoTranslateCachedOnly && DBState.db.translatorType === 'llm'){
|
||||||
const cache = await getLLMCache(data)
|
const cache = DBState.db.translateBeforeHTMLFormatting
|
||||||
if(cache !== null){
|
? await getLLMCache(data)
|
||||||
translateText = true
|
: await getLLMCache(await ParseMarkdown(data, charArg, 'pretranslate', chatID, getCbsCondition()))
|
||||||
}
|
|
||||||
|
translateText = cache !== null
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
translateText = true
|
translateText = true
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ export async function runTranslator(text:string, reverse:boolean, from:string,ta
|
|||||||
async function translateMain(text:string, arg:{from:string, to:string, host:string}){
|
async function translateMain(text:string, arg:{from:string, to:string, host:string}){
|
||||||
let db = getDatabase()
|
let db = getDatabase()
|
||||||
if(db.translatorType === 'llm'){
|
if(db.translatorType === 'llm'){
|
||||||
const tr = db.translator || 'en'
|
const tr = arg.to || 'en'
|
||||||
return translateLLM(text, {to: tr})
|
return translateLLM(text, {to: tr})
|
||||||
}
|
}
|
||||||
if(db.translatorType === 'deepl'){
|
if(db.translatorType === 'deepl'){
|
||||||
|
|||||||
Reference in New Issue
Block a user