mirror of
https://github.com/w0rng/amnezia-wg-easy.git
synced 2025-04-27 05:40:05 +03:00
add multilanguage support and add russian language
This commit is contained in:
parent
bbd19b7a6f
commit
ceacaa9e3c
6 changed files with 134 additions and 38 deletions
|
@ -23,8 +23,15 @@ function bytes(bytes, decimals, kib, maxunit) {
|
|||
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
||||
}
|
||||
|
||||
const i18n = new VueI18n({
|
||||
locale: localStorage.getItem('lang') || 'en',
|
||||
fallbackLocale: 'en',
|
||||
messages,
|
||||
});
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
i18n,
|
||||
components: {
|
||||
apexchart: VueApexCharts,
|
||||
},
|
||||
|
@ -48,6 +55,8 @@ new Vue({
|
|||
currentRelease: null,
|
||||
latestRelease: null,
|
||||
|
||||
langDropdownShow: false,
|
||||
|
||||
chartOptions: {
|
||||
chart: {
|
||||
background: 'transparent',
|
||||
|
@ -243,11 +252,15 @@ new Vue({
|
|||
.catch(err => alert(err.message || err.toString()))
|
||||
.finally(() => this.refresh().catch(console.error));
|
||||
},
|
||||
changeLang(lang) {
|
||||
localStorage.setItem('lang', lang);
|
||||
i18n.locale = lang;
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
bytes,
|
||||
timeago: value => {
|
||||
return timeago().format(value);
|
||||
return timeago.format(value, i18n.locale);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue