Add LibreTranslate support #224
Loading…
Reference in a new issue
No description provided.
Delete branch "libretranslate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Admins will need to specify the API endpoint of the LibreTranslate instance being used. An API key can be optionally specified if the instance of choice does any ratelimiting on non-authenticated requests.
To-do:
Resolves: #173
Changelog: Added
dd803e4c9b
tof03e64d157
A few things I'm kinda wondering about:
meta
table like they currently do, or should those be in the config file?@ -183,3 +201,3 @@
let swPublicKey: any = $ref(null);
let swPrivateKey: any = $ref(null);
let deeplAuthKey: string = $ref('');
let translationService: string = $ref('');
Shouldn't this start out as a "valid" value, e.g. start out as
'none'
?494b9236db
to64fb594ddd
@ -0,0 +2,4 @@
name = 'addLibretranslate1668661888188'
async up(queryRunner) {
await queryRunner.query(`CREATE TYPE "public"."meta_translationservice_enum" AS ENUM('none', 'deepl', 'libretranslate')`);
Wouldn't it make more sense to use
NULL
instead of an explicit enum key?Yeah, that makes more sense.
f2be6afd46
to03338d35f2
03338d35f2
toc24ead3830
This may need the fix from #239 to work properly since I've had some issues with actually getting the libretranslate settings to apply in the admin interface.Fixed in
28aa440bcc
c24ead3830
to3b2773c3fc
WIP: Add LibreTranslate supportto Add LibreTranslate support@ -0,0 +2,4 @@
name = 'addLibretranslate1668661888188'
async up(queryRunner) {
await queryRunner.query(`CREATE TYPE "public"."meta_translationservice_enum" AS ENUM('deepl', 'libretranslate')`);
I think this does not properly migrate the case when DeepL is already set up.
@ -131,3 +131,3 @@
<FormSection>
<template #label>DeepL Translation</template>
<template #label>{{ i18n.ts.translationSettings }}</template>
I think this may be a bit hard to find. Maybe it should be on a separate settings page? Before commit
533955f928
it was on the "other" settings page.Not really sure why the new page doesn't seem to work properly, but I did add one just now.
@ -162,0 +209,4 @@
case TranslationService.DeepL:
return translateDeepL();
case TranslationService.LibreTranslate:
return translateLibreTranslate();
I'm not sure if these need to be
await
ed?Probably a good idea.
Seems like the new settings page decided to work all of a sudden today. Additional testing would be appreciated.
@ -58,2 +60,4 @@
deeplAuthKey: { type: 'string', nullable: true },
deeplIsPro: { type: 'boolean' },
libreTranslateAuthKey: { type: 'string', nullable: true },
libreTranslateEndpoint: { type: 'string', nullable: true },
You need to actually add these to
set
so they are saved into the DB.Probably would also be a good idea to somehow make sure that you can't set translation service to something without the credentials for that being set up as well.
64fe6655f6
toe03428b83f
e03428b83f
to8e818195b1
8e818195b1
toa66ef89059
62f9d43303
tocfe0f3ca67