- Fix: choose language : added flags
This commit is contained in:
@@ -102,8 +102,9 @@ namespace Mutations {
|
||||
}
|
||||
|
||||
function setlang(state: IUserState, newstr: string) {
|
||||
console.log('SETLANG', newstr)
|
||||
state.lang = newstr
|
||||
localStorage.setItem('lang', state.lang)
|
||||
localStorage.setItem(rescodes.localStorage.lang, state.lang)
|
||||
}
|
||||
|
||||
function UpdatePwd(state: IUserState, data: IIdToken) {
|
||||
@@ -339,6 +340,7 @@ namespace Actions {
|
||||
const now = new Date()
|
||||
// const expirationDate = new Date(now.getTime() + myres.data.expiresIn * 1000);
|
||||
const expirationDate = new Date(now.getTime() * 1000)
|
||||
localStorage.setItem(rescodes.localStorage.lang, state.lang)
|
||||
localStorage.setItem(rescodes.localStorage.userId, userId)
|
||||
localStorage.setItem(rescodes.localStorage.username, username)
|
||||
localStorage.setItem(rescodes.localStorage.token, state.x_auth_token)
|
||||
@@ -453,6 +455,7 @@ namespace Actions {
|
||||
const now = new Date()
|
||||
// const expirationDate = new Date(now.getTime() + myres.data.expiresIn * 1000);
|
||||
const expirationDate = new Date(now.getTime() * 1000)
|
||||
localStorage.setItem(rescodes.localStorage.lang, state.lang)
|
||||
localStorage.setItem(rescodes.localStorage.userId, userId)
|
||||
localStorage.setItem(rescodes.localStorage.username, username)
|
||||
localStorage.setItem(rescodes.localStorage.token, state.x_auth_token)
|
||||
@@ -540,12 +543,7 @@ namespace Actions {
|
||||
// console.log('*** autologin_FromLocalStorage ***')
|
||||
// INIT
|
||||
|
||||
UserStore.mutations.setlang(process.env.LANG_DEFAULT)
|
||||
// Estrai la Lang dal Localstorage
|
||||
const lang = localStorage.getItem('lang')
|
||||
if (lang) {
|
||||
UserStore.mutations.setlang(lang)
|
||||
}
|
||||
UserStore.state.lang = localStorage.getItem(rescodes.localStorage.lang)
|
||||
|
||||
const token = localStorage.getItem(rescodes.localStorage.token)
|
||||
if (!token) {
|
||||
|
||||
@@ -20,7 +20,8 @@ export const rescodes = {
|
||||
leftDrawerOpen: 'ldo',
|
||||
userId: 'uid',
|
||||
token: 'tk',
|
||||
username: 'uname'
|
||||
username: 'uname',
|
||||
lang:'lg'
|
||||
},
|
||||
|
||||
Todos: {
|
||||
@@ -67,7 +68,45 @@ export const rescodes = {
|
||||
value: 0,
|
||||
icon: 'expand_more'
|
||||
}],
|
||||
'enUk': [
|
||||
'es': [
|
||||
{
|
||||
id: 1,
|
||||
label: 'Alta',
|
||||
value: 2,
|
||||
icon: 'expand_less'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: 'Normal',
|
||||
value: 1,
|
||||
icon: 'remove'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: 'Baja',
|
||||
value: 0,
|
||||
icon: 'expand_more'
|
||||
}],
|
||||
'enUs': [
|
||||
{
|
||||
id: 1,
|
||||
label: 'High',
|
||||
value: 2,
|
||||
icon: 'expand_less'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: 'Normal',
|
||||
value: 1,
|
||||
icon: 'remove'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: 'Low',
|
||||
value: 0,
|
||||
icon: 'expand_more'
|
||||
}],
|
||||
'de': [
|
||||
{
|
||||
id: 1,
|
||||
label: 'High',
|
||||
@@ -87,6 +126,7 @@ export const rescodes = {
|
||||
icon: 'expand_more'
|
||||
}]
|
||||
|
||||
|
||||
},
|
||||
|
||||
INDEX_MENU_DELETE: 4,
|
||||
@@ -129,7 +169,44 @@ export const rescodes = {
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
'enUk': [
|
||||
'es': [
|
||||
{
|
||||
id: 10,
|
||||
label: '',
|
||||
value: 120, // PROGRESS_BAR
|
||||
icon: 'rowing',
|
||||
checked: true
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
label: 'Establecer Prioridad',
|
||||
value: 130, // PRIORITY
|
||||
icon: 'rowing',
|
||||
checked: false
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
label: 'Completado',
|
||||
value: 110, // COMPLETED
|
||||
icon: 'check_circle',
|
||||
checked: true
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
label: 'Establecer expiración',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
checked: true
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
label: 'Borrar',
|
||||
value: 100, // DELETE
|
||||
icon: 'delete',
|
||||
checked: false
|
||||
}
|
||||
],
|
||||
'enUs': [
|
||||
{
|
||||
id: 10,
|
||||
label: '',
|
||||
|
||||
Reference in New Issue
Block a user