mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
fix(server): ja-JPのような形式にDeepLが対応してない
This commit is contained in:
parent
eac8d413f5
commit
a4c930a94c
1 changed files with 4 additions and 1 deletions
|
@ -53,10 +53,13 @@ export default define(meta, async (ps, user) => {
|
||||||
return 204; // TODO: 良い感じのエラー返す
|
return 204; // TODO: 良い感じのエラー返す
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let targetLang = ps.targetLang;
|
||||||
|
if (targetLang.includes('-')) targetLang = targetLang.split('-')[0];
|
||||||
|
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
params.append('auth_key', instance.deeplAuthKey);
|
params.append('auth_key', instance.deeplAuthKey);
|
||||||
params.append('text', note.text);
|
params.append('text', note.text);
|
||||||
params.append('target_lang', ps.targetLang);
|
params.append('target_lang', targetLang);
|
||||||
|
|
||||||
const res = await fetch('https://api-free.deepl.com/v2/translate', {
|
const res = await fetch('https://api-free.deepl.com/v2/translate', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
Loading…
Reference in a new issue