Add behavior intern i18n system

This commit is contained in:
2022-03-29 10:57:28 +08:00
parent 791b554ca0
commit b6f8828c3b
8 changed files with 71 additions and 17 deletions
+11 -2
View File
@@ -4,7 +4,8 @@ import { FunctionComponent } from "react";
import "./Message.scss";
interface IMessageProps {
i18nKey: AllI18nKeys;
i18nKey?: AllI18nKeys;
text?: string;
options?: Record<string, string>;
className?: string;
isTitle?: boolean;
@@ -34,7 +35,15 @@ const MessageView: FunctionComponent<IMessageProps & IMixinSettingProps> = (prop
}
return <div className={classList.join(" ")}>
<span className={language}>{I18N(language, props.i18nKey, props.options)}</span>
{
props.text ?
<span className={language}>{props.text}</span> :
props.i18nKey ?
<span className={language}>{
I18N(language, props.i18nKey, props.options)
}</span> :
null
}
</div>
}