Skip to content

Commit

Permalink
1.88.1 (#331)
Browse files Browse the repository at this point in the history
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?

# Description
  • Loading branch information
kwaroran authored Mar 25, 2024
2 parents a047506 + 026e47c commit ff0bd4e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "RisuAI",
"version": "1.88.0"
"version": "1.88.1"
},
"tauri": {
"allowlist": {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Setting/Pages/LanguageSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
{/if}

{#if $DataBase.translatorType === 'deeplX'}
<span class="text-textcolor mt-4">{language.deeplXUrl}</span>
<span class="text-textcolor mt-4" placeholder="http://localhost:1188">{language.deeplXUrl}</span>
<TextInput bind:value={$DataBase.deeplXOptions.url} />

<span class="text-textcolor mt-4">{language.deeplXToken}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/ts/storage/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';

export const DataBase = writable({} as any as Database)
export const loadedStore = writable(false)
export let appVer = "1.88.0"
export let appVer = "1.88.1"
export let webAppSubVer = ''

export function setDatabase(data:Database){
Expand Down
11 changes: 9 additions & 2 deletions src/ts/translator/translator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async function translateMain(text:string, arg:{from:string, to:string, host:stri
}
}

let url = db.deeplXOptions.url;
let url = db.deeplXOptions.url ?? 'http://localhost:1188'

if(url.endsWith('/')){
url = url.slice(0, -1)
Expand Down Expand Up @@ -237,10 +237,13 @@ export async function translateHTML(html: string, reverse:boolean, charArg:simpl


async function translateTranslationChunks(force:boolean = false, additionalChunkLength = 0){
if(translationChunks.length === 0 || !needSuperChunkedTranslate()){
return
}

const currentChunk = translationChunks[translationChunks.length-1]
const text: string = currentChunk.chunks.join('\n■\n')

console.log(text)
if(!force && text.length + additionalChunkLength < 5000){
return
}
Expand All @@ -250,6 +253,10 @@ export async function translateHTML(html: string, reverse:boolean, charArg:simpl
resolvers: []
})

if(!text){
return
}

const translated = await translate(text, reverse)

const split = translated.split('■')
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.88.0"}
{"version":"1.88.1"}

0 comments on commit ff0bd4e

Please sign in to comment.