feat: supports plain text translation

This commit is contained in:
Gabe
2025-11-15 14:25:05 +08:00
parent 49a7698993
commit abcf2baad6
4 changed files with 51 additions and 6 deletions

View File

@@ -112,7 +112,10 @@ export default function PopupCont({
const handleChange = async (e) => {
try {
const { name, value } = e.target;
let { name, value, checked } = e.target;
if (name === "isPlainText") {
value = checked;
}
setRule((pre) => ({ ...pre, [name]: value }));
if (!processActions) {
@@ -204,6 +207,7 @@ export default function PopupCont({
transOnly,
hasRichText,
hasShadowroot,
isPlainText = false,
} = rule;
return (
@@ -322,6 +326,20 @@ export default function PopupCont({
label={i18n("input_translate")}
/>
</Grid>
<Grid item xs={6}>
<FormControlLabel
control={
<Switch
size="small"
name="isPlainText"
value={!isPlainText}
checked={isPlainText}
onChange={handleChange}
/>
}
label={i18n("plain_text_translate")}
/>
</Grid>
</Grid>
<TextField