feat: Support for multiple translation services in tranbox

This commit is contained in:
Gabe
2025-10-02 11:33:33 +08:00
parent 039566ded5
commit 389f0b6f82
9 changed files with 41 additions and 36 deletions

View File

@@ -287,7 +287,7 @@ function TranForm({
/>
)}
{enDict !== "-" && (
{enDict !== "-" && isValidWord(text) && (
<>
<DictCont text={text} />
<SugCont text={text} />

View File

@@ -18,7 +18,7 @@ export default function TranCont({
toLang,
toLang2 = "en",
transApis,
simpleStyle,
simpleStyle = false,
langDetector,
}) {
const i18n = useI18n();
@@ -27,6 +27,10 @@ export default function TranCont({
const [error, setError] = useState("");
useEffect(() => {
if (!text?.trim()) {
return;
}
(async () => {
try {
setLoading(true);