Skip to content

Commit a6e6427

Browse files
fix storeLang
1 parent 899eac5 commit a6e6427

5 files changed

Lines changed: 16 additions & 29 deletions

File tree

public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
88
<title><%= htmlWebpackPlugin.options.title %></title>
9-
<link type="text/css" rel="stylesheet" href="/bootstrap/bootstrap-vue-icons.min.css" />
9+
<link type="text/css" rel="stylesheet" href="bootstrap/bootstrap-vue-icons.min.css" />
1010

1111
</head>
1212
<body>
1313
<noscript>
1414
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
1515
</noscript>
16-
<div id="app"></div>
16+
<div id="app">Loading..</div>
1717
<!-- built files will be auto injected -->
1818
</body>
1919
</html>

src/App.vue

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
<template>
22
<div id="app">
3-
<!--
4-
<div id="nav">
5-
<span class="badge badge-info">{{allKeys.length}}</span> <router-link to="/">Home</router-link>
6-
<router-link to="/about">About</router-link>
7-
</div>
8-
-->
93
<router-view/>
10-
11-
4+
<vue-snotify></vue-snotify>
125
</div>
136
</template>
147

158
<script>
16-
//import {generateToken} from "node-2fa";
179
1810
export default {
19-
computed: {
20-
language() {
21-
return this.$store.getters['app/language'];
22-
}
23-
},
2411
methods: {
2512
2613
minimize: function () {
@@ -38,9 +25,7 @@ export default {
3825
window.close()
3926
}
4027
},
41-
reload: function () {
42-
// reload();
43-
}
28+
4429
},
4530
async created() {
4631
if (navigator.language === 'ru') {
@@ -50,8 +35,10 @@ export default {
5035
}
5136
this.$store._vm.$on('vuex-persist:ready', async () => {
5237
//console.log(await this.$store.getters['keys2fa/faKeys'])
53-
this.$i18n.locale = this.language;
54-
38+
const storeLang = this.$store.getters['app/language'];
39+
if (storeLang) {
40+
this.$i18n.locale = storeLang;
41+
}
5542
})
5643
}
5744
}

src/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang": "Language",
33
"import_from_google": "Import from Google 2FA",
4-
"save_to_file": "Save all keys to file",
4+
"save_to_file": "Save all keys in file",
55
"copied": "Token Copied!",
66
"powered": "Powered by",
77
"cancel": "Cancel"

src/views/Home.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="w-100">
33
<b-navbar toggleable="lg" type="dark" variant="info" :sticky="true" fixed="top"
44
style="position: fixed;background: linear-gradient(-45deg, #9510b2 1%, #4eabf7 48%, #fbbe8d);">
5-
<b-navbar-brand><img width="22px" src="/images/logo48.png"/> Smart2FA</b-navbar-brand>
5+
<b-navbar-brand><img width="22px" src="images/logo48.png"/> Smart2FA</b-navbar-brand>
66

77
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
88

@@ -35,10 +35,10 @@
3535
</b-navbar-nav>
3636
</b-collapse>
3737
</b-navbar>
38-
<vue-snotify></vue-snotify>
38+
3939
<!--{{storedKeys}}-->
4040
<div v-if="op === 'importKeys'"
41-
style="backdrop-filter: blur(4px); background: rgba(43,68,87,0.63); width: 100%; height: 100vh; position: absolute; top:0; padding: 4% !important; margin: 0 !important; ">
41+
style="backdrop-filter: blur(4px); background: rgba(43,68,87,0.63); width: 100%; height: 100vh; position: absolute; top:0; padding: 4% !important; margin: 0 !important; z-index: 200000;">
4242
<QrScanImport2fa
4343
style="margin-left: auto; margin-right: auto; width:250px; height:250px; border: solid 2px #333;margin-top: 50px;"/>
4444
<div style="margin-left: auto; margin-right: auto;width:25px;margin-bottom: 5px; margin-top: 10px;">
@@ -47,15 +47,15 @@
4747
</div>
4848

4949
<div v-if="op === 'addKeyIn'"
50-
style="backdrop-filter: blur(4px); background: rgba(43,68,87,0.63); width: 100%; height: 100vh; position: absolute; top:0; padding: 1% !important; margin: 0 !important; ">
50+
style="backdrop-filter: blur(4px); background: rgba(43,68,87,0.63); width: 100%; height: 100vh; position: absolute; top:0; padding: 1% !important; margin: 0 !important;z-index: 200000; ">
5151
<AddNewKeyIn style="margin-left: auto; margin-right: auto; width:100%; margin-top: 80px;"/>
5252
<div style="margin-left: auto; margin-right: auto;width:25px;margin-bottom: 5px; margin-top: 10px;">
5353
<b-button @click="op = 'home'" :pill="true" variant="info">X</b-button>
5454
</div>
5555
</div>
5656

5757
<div v-if="op === 'addKeyQR'"
58-
style="backdrop-filter: blur(4px); background: rgba(43,68,87,0.63); width: 100%; height: 100vh; position: absolute; top:0; padding: 4% !important; margin: 0 !important; ">
58+
style="backdrop-filter: blur(4px); background: rgba(43,68,87,0.63); width: 100%; height: 100vh; position: absolute; top:0; padding: 4% !important; margin: 0 !important;z-index: 200000; ">
5959
<AddNewKeyQr
6060
style="margin-left: auto; margin-right: auto; width:250px; height:250px; border: solid 2px #333;margin-top: 50px;"/>
6161
<div style="margin-left: auto; margin-right: auto;width:25px;margin-bottom: 5px; margin-top: 10px;">

vue.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ module.exports = {
3232
pluginOptions: {
3333
cordovaPath: 'src-cordova',
3434
i18n: {
35+
lazy:true,
3536
locale: 'en',
3637
fallbackLocale: 'en',
3738
localeDir: 'locales',
38-
enableInSFC: false,
39-
enableBridge: undefined
39+
enableInSFC: false
4040
},
4141
electronBuilder: {
4242
electronBuilder: {

0 commit comments

Comments
 (0)