mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-31 08:20:07 +08:00
特性-市场插件的国际化支持
This commit is contained in:
19
feature/src/languages/i18n.ts
Normal file
19
feature/src/languages/i18n.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import messages from './langs';
|
||||
const { remote } = window.require('electron');
|
||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
||||
|
||||
console.log(messages);
|
||||
console.log(perf);
|
||||
|
||||
// 2. Create i18n instance with options
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: perf.common.lang || 'zh-CN', // set locale
|
||||
fallbackLocale: 'zh-CN', // set fallback locale
|
||||
messages, // set locale messages
|
||||
// If you need to specify other options, you can set other options
|
||||
// ...
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in New Issue
Block a user