modify langs map

This commit is contained in:
Gabe Yuan
2023-10-13 10:48:01 +08:00
parent 5746911651
commit 6d5b93c01b
2 changed files with 16 additions and 4 deletions

View File

@@ -275,8 +275,13 @@ export const apiTranslate = ({
toLang,
apiSetting,
}) => {
const from = OPT_LANGS_SPECIAL[translator]?.get(fromLang) ?? fromLang;
const to = OPT_LANGS_SPECIAL[translator]?.get(toLang) ?? toLang;
const from = OPT_LANGS_SPECIAL[translator].get(fromLang);
const to = OPT_LANGS_SPECIAL[translator].get(toLang);
if (!to) {
return ["", from === to];
}
const callApi = (api) => api(translator, text, to, from, apiSetting);
switch (translator) {