UPD: Change locale file to .json for Easy i18n
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
// 'en' Locale
|
|
||||||
export default {
|
|
||||||
navbar: {
|
|
||||||
device: {
|
|
||||||
title: 'Device',
|
|
||||||
connect: 'Connect',
|
|
||||||
disconnect: 'Disconnect',
|
|
||||||
about: 'About Device',
|
|
||||||
preferences: 'Preferences',
|
|
||||||
export: 'Export JSON',
|
|
||||||
import: 'Import JSON',
|
|
||||||
quit: 'Quit'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
14
src/lang/en.json
Normal file
14
src/lang/en.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"navbar": {
|
||||||
|
"device": {
|
||||||
|
"title": "Device",
|
||||||
|
"connect": "Connect",
|
||||||
|
"disconnect": "Disconnect",
|
||||||
|
"about": "About Device",
|
||||||
|
"preferences": "Preferences",
|
||||||
|
"export": "Export JSON",
|
||||||
|
"import": "Import JSON",
|
||||||
|
"quit": "Quit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,14 +3,15 @@ import './assets/main.css'
|
|||||||
import {createApp} from 'vue'
|
import {createApp} from 'vue'
|
||||||
import {createI18n} from 'vue-i18n'
|
import {createI18n} from 'vue-i18n'
|
||||||
|
|
||||||
import en from './lang/en.js'
|
import en from './lang/en.json'
|
||||||
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
|
// Create VueI18n instance with locales loaded from /lang directory
|
||||||
const i18n = createI18n({
|
const i18n = createI18n({
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
fallbackLocale: 'en',
|
fallbackLocale: 'en',
|
||||||
messages: {en}
|
messages: {en: en}
|
||||||
})
|
})
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|||||||
Reference in New Issue
Block a user