This repository was archived by the owner on Mar 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +59
-3
lines changed
Expand file tree Collapse file tree 6 files changed +59
-3
lines changed Original file line number Diff line number Diff line change 1+ // This is just an example,
2+ // so you can safely delete all default props below
3+
4+ export default {
5+ leftDrawer : {
6+ home : {
7+ main : "目录" ,
8+ sub : "从此开始"
9+ }
10+ } ,
11+ failed : "你好" ,
12+ success : "bu hao"
13+ } ;
Original file line number Diff line number Diff line change 22// so you can safely delete all default props below
33
44export default {
5- failed : "Action failed" ,
5+ leftDrawer : {
6+ home : {
7+ main : "Home" ,
8+ sub : "Start here"
9+ }
10+ } ,
11+ failed : "Hello" ,
612 success : "Action was successful"
713} ;
Original file line number Diff line number Diff line change 11import enUS from "./en-us" ;
2+ import cnCN from "./cn-cn" ;
23
34export default {
4- "en-us" : enUS
5+ "en-us" : enUS ,
6+ "cn-cn" : cnCN
57} ;
Original file line number Diff line number Diff line change 1313 </q-btn >
1414
1515 <q-toolbar-title >Verbose Equals True</q-toolbar-title >
16+
17+ <q-select v-model =" lang" :options =" langs" />
1618 <q-btn
1719 id =" login"
1820 :ripple =" false"
4244import AuthModal from " components/AuthModal.vue" ;
4345
4446export default {
47+ data () {
48+ return {
49+ lang: this .$i18n .locale ,
50+ langs: [
51+ {
52+ label: " Chinese" ,
53+ value: " cn-cn"
54+ },
55+ {
56+ label: " US English" ,
57+ value: " en-us"
58+ }
59+ ]
60+ };
61+ },
4562 components: { AuthModal },
4663 methods: {
4764 logout () {
@@ -51,6 +68,17 @@ export default {
5168 toggleLeftDrawer () {
5269 this .$store .commit (" toggleLeftDrawer" );
5370 }
71+ },
72+ created () {
73+ this .$i18n .locale = " cn-cn" ;
74+ },
75+ watch: {
76+ lang (lang ) {
77+ this .$i18n .locale = lang;
78+ // import(`quasar/i18n/${lang}`).then(language => {
79+ // this.$q.lang.set(language.default)
80+ // })
81+ }
5482 }
5583};
5684 </script >
Original file line number Diff line number Diff line change 88 <q-list >
99 <q-item-label header >Menu</q-item-label >
1010
11- <left-menu-link label =" Home" to =" /" icon =" home" caption =" Start Here" />
11+ <left-menu-link
12+ :label =" $t('leftDrawer.home.main')"
13+ to =" /"
14+ icon =" home"
15+ caption =" Start Here"
16+ />
1217
1318 <left-menu-link
1419 label =" About"
Original file line number Diff line number Diff line change 11<template >
22 <base-page >
33 <h4 >Environment Variables</h4 >
4+
5+ {{ $t("failed") }}
46 <div v-for =" (value, key) in env" :key =" key" >
57 <q-chip >{{ key }}</q-chip
68 ><q-chip text-color =" white" color =" teal" >{{ value }}</q-chip >
You can’t perform that action at this time.
0 commit comments