add global rule text

This commit is contained in:
Gabe Yuan
2023-09-10 14:51:16 +08:00
parent 62a60eee44
commit 399c6b6fed
2 changed files with 8 additions and 1 deletions

View File

@@ -541,4 +541,8 @@ export const I18N = {
zh: `保存规则`,
en: `"Save Rule`,
},
global_rule: {
zh: `全局规则`,
en: `Global Rule`,
},
};

View File

@@ -362,6 +362,7 @@ function RuleFields({ rule, rules, setShow, setKeyword }) {
}
function RuleAccordion({ rule, rules }) {
const i18n = useI18n();
const [expanded, setExpanded] = useState(false);
const handleChange = (e) => {
@@ -376,7 +377,9 @@ function RuleAccordion({ rule, rules }) {
opacity: rules ? 1 : 0.5,
}}
>
{rule.pattern}
{rule.pattern === GLOBAL_KEY
? `[${i18n("global_rule")}] ${rule.pattern}`
: rule.pattern}
</Typography>
</AccordionSummary>
<AccordionDetails>