refactor: Split config files

This commit is contained in:
Gabe
2025-09-01 18:56:48 +08:00
parent c4fba1c905
commit 2bfb27f346
17 changed files with 821 additions and 863 deletions

View File

@@ -31,7 +31,6 @@ import {
OPT_TRANS_CUSTOMIZE_4,
OPT_TRANS_CUSTOMIZE_5,
OPT_TRANS_NIUTRANS,
URL_NIUTRANS_REG,
DEFAULT_FETCH_LIMIT,
DEFAULT_FETCH_INTERVAL,
DEFAULT_HTTP_TIMEOUT,
@@ -201,7 +200,10 @@ function ApiFields({ translator, api, updateApi, resetApi }) {
translator === OPT_TRANS_NIUTRANS ? (
<>
{i18n("mulkeys_help")}
<Link href={URL_NIUTRANS_REG} target="_blank">
<Link
href="https://niutrans.com/login?active=3&userSource=kiss-translator"
target="_blank"
>
{i18n("reg_niutrans")}
</Link>
</>

View File

@@ -43,14 +43,14 @@ export default function TranCont({
const apiSetting =
transApis[translator] || DEFAULT_TRANS_APIS[translator];
const tranRes = await apiTranslate({
const [trText] = await apiTranslate({
text,
translator,
fromLang,
toLang: to,
apiSetting,
});
setTrText(tranRes[0]);
setTrText(trText);
} catch (err) {
setError(err.message);
} finally {