You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/client/web/plugins/com.msgbyte.miaolang/src/reg.ts

21 lines
467 B
TypeScript

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);
},
});