dev.....!

This commit is contained in:
Gabe Yuan
2023-08-31 13:38:06 +08:00
parent aa795e2731
commit 4486ad353c
15 changed files with 50 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
import { useEffect } from "react";
import { useState } from "react";
import { detectLang } from "../libs";
import { tryDetectLang } from "../libs";
import { apiTranslate } from "../apis";
/**
@@ -22,8 +22,8 @@ export function useTranslate(q, rule, setting) {
try {
setLoading(true);
const deLang = await detectLang(q);
if (toLang.includes(deLang)) {
const deLang = await tryDetectLang(q);
if (deLang && toLang.includes(deLang)) {
setSamelang(true);
} else {
const [trText, isSame] = await apiTranslate({