Add autoTranslateCachedOnly option to auto-translate only previously translated text when enabled.

This commit is contained in:
Bo26fhmC5M
2024-11-28 21:53:15 +09:00
parent b6ee2928dd
commit ae6d12ea29
5 changed files with 23 additions and 2 deletions

View File

@@ -846,6 +846,7 @@ export interface Database{
otherAx: SeparateParameters
}
translateBeforeHTMLFormatting:boolean
autoTranslateCachedOnly:boolean
}
interface SeparateParameters{

View File

@@ -507,4 +507,8 @@ async function translateLLM(text:string, arg:{to:string, regenerate?:boolean}):P
}).replace(/<\/style-data>/g, '')
await LLMCacheStorage.setItem(text, result)
return result
}
export async function getLLMCache(text:string):Promise<string | null>{
return await LLMCacheStorage.getItem(text)
}