mirror of https://github.com/msgbyte/tailchat
refactor(web): reduce plugin entry filesize
parent
07ece84fb1
commit
229a575ab5
@ -0,0 +1,20 @@
|
|||||||
|
import { decode, encode, isMiao } from './miaotrans';
|
||||||
|
import { regMessageInterpreter } from '@capital/common';
|
||||||
|
import { Translate } from './translate';
|
||||||
|
|
||||||
|
const miao = encode('喵语翻译已加载');
|
||||||
|
const human = decode(miao);
|
||||||
|
|
||||||
|
console.log(`${miao}\n${human}`);
|
||||||
|
|
||||||
|
regMessageInterpreter({
|
||||||
|
name: Translate.miaoTrans,
|
||||||
|
explainMessage(message: string) {
|
||||||
|
// 喵语 -> 人话
|
||||||
|
if (!isMiao(message)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return decode(message);
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue