You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { createI18n, I18nInstance } from 'vue3-i18n';
|
|
|
|
import Zh from './zh';
|
|
|
|
import En from './en';
|
|
|
|
|
|
|
|
const messages = {
|
|
|
|
zh: new Zh(),
|
|
|
|
en: new En(),
|
|
|
|
};
|
|
|
|
const i18n = createI18n({
|
|
|
|
locale: 'zh',
|
|
|
|
messages,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const createt = (sufix: string) => {
|
|
|
|
return (key: string): string => {
|
|
|
|
key = sufix + key;
|
|
|
|
return i18n.t(key);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// export class Myi18n {
|
|
|
|
// mt: (key: string) => string;
|
|
|
|
// constructor(sufix: string) {
|
|
|
|
// this.mt =
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
export default i18n;
|