@ -149,6 +149,10 @@ export const meta = {
|
||||
validator: $.optional.nullable.str,
|
||||
},
|
||||
|
||||
deeplIsPro: {
|
||||
validator: $.optional.bool,
|
||||
},
|
||||
|
||||
enableTwitterIntegration: {
|
||||
validator: $.optional.bool,
|
||||
},
|
||||
@ -574,6 +578,10 @@ export default define(meta, async (ps, me) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (ps.deeplIsPro !== undefined) {
|
||||
set.deeplIsPro = ps.deeplIsPro;
|
||||
}
|
||||
|
||||
await getConnection().transaction(async transactionalEntityManager => {
|
||||
const meta = await transactionalEntityManager.findOne(Meta, {
|
||||
order: {
|
||||
|
@ -583,6 +583,8 @@ export default define(meta, async (ps, me) => {
|
||||
response.objectStorageUseProxy = instance.objectStorageUseProxy;
|
||||
response.objectStorageSetPublicRead = instance.objectStorageSetPublicRead;
|
||||
response.objectStorageS3ForcePathStyle = instance.objectStorageS3ForcePathStyle;
|
||||
response.deeplAuthKey = instance.deeplAuthKey;
|
||||
response.deeplIsPro = instance.deeplIsPro;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,9 @@ export default define(meta, async (ps, user) => {
|
||||
params.append('text', note.text);
|
||||
params.append('target_lang', targetLang);
|
||||
|
||||
const res = await fetch('https://api-free.deepl.com/v2/translate', {
|
||||
const endpoint = instance.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate';
|
||||
|
||||
const res = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
|
Reference in New Issue
Block a user