mirror of https://github.com/msgbyte/tailchat
feat: 喵语翻译插件增加国际化支持
parent
2a2b33578a
commit
8d18e70233
@ -1,7 +1,10 @@
|
|||||||
import Miao from 'miao-lang';
|
import Miao from 'miao-lang';
|
||||||
|
import { Translate } from './translate';
|
||||||
|
|
||||||
export function encode(human: string): string {
|
export function encode(human: string): string {
|
||||||
return Miao.encode(human);
|
return Miao.encode(human, {
|
||||||
|
calls: Translate.calls,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function decode(miao: string): string {
|
export function decode(miao: string): string {
|
@ -0,0 +1,9 @@
|
|||||||
|
import { localTrans } from '@capital/common';
|
||||||
|
|
||||||
|
export const Translate = {
|
||||||
|
miaoTrans: localTrans({ 'zh-CN': '喵语翻译', 'en-US': 'Meow Translate' }),
|
||||||
|
title: localTrans({ 'zh-CN': '喵言喵语', 'en-US': 'Meow meow' }),
|
||||||
|
send: localTrans({ 'zh-CN': '发送喵语', 'en-US': 'Send meow' }),
|
||||||
|
inputHuman: localTrans({ 'zh-CN': '输入人话', 'en-US': 'Input Human' }),
|
||||||
|
calls: localTrans({ 'zh-CN': '喵', 'en-US': 'Meow~' }),
|
||||||
|
};
|
Loading…
Reference in New Issue