From b11dd46f9f545bcbb16689015ad561c563ee1fb5 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Fri, 12 Jul 2019 14:09:44 +0200 Subject: [PATCH] Form Newsletter and others fix --- src/boot/vue-i18n.ts | 2 +- src/components/CDate/CDate.ts | 1 + src/components/CProgress/CProgress.ts | 1 + src/components/Header/Header.ts | 1 + src/components/index.ts | 3 ++ src/components/logo/logo.ts | 1 + .../projects/SingleProject/SingleProject.ts | 5 ++- .../projects/SubMenusProj/SubMenusProj.ts | 1 + src/components/todos/CTodo/CTodo.ts | 5 ++- src/components/todos/SingleTodo/SingleTodo.ts | 5 ++- src/components/todos/SubMenus/SubMenus.ts | 1 + src/globalroutines/indexdb.ts | 4 +- src/globalroutines/util.ts | 4 +- .../toolbar/messagePopover/messagePopover.ts | 1 + src/model/Projects.ts | 1 + src/statics/i18n.js | 42 +++++++++++++++-- src/store/Api/Instance.ts | 1 + src/store/Api/index.ts | 1 + src/store/Modules/ApiTables.ts | 3 +- src/store/Modules/GlobalStore.ts | 3 +- src/store/Modules/Projects.ts | 1 + src/store/Modules/Todos.ts | 1 + src/store/Modules/UserStore.ts | 3 +- src/store/Modules/costanti.ts | 4 +- src/store/Modules/tools.ts | 45 ++++++++++--------- src/views/categories/TableData/TableData.ts | 1 + src/views/categories/category/category.ts | 1 + src/views/login/requestresetpwd.vue | 1 + src/views/login/signin/signin.ts | 7 +-- src/views/login/signup/signup.ts | 1 + src/views/login/updatepassword.vue | 1 + src/views/projects/proj-list/proj-list.ts | 13 +++--- src/views/todo-list/todo-list.ts | 1 + 33 files changed, 119 insertions(+), 47 deletions(-) diff --git a/src/boot/vue-i18n.ts b/src/boot/vue-i18n.ts index 428d98b..4acdfa4 100644 --- a/src/boot/vue-i18n.ts +++ b/src/boot/vue-i18n.ts @@ -2,7 +2,7 @@ import VueI18n from 'vue-i18n' import messages from '../statics/i18n' import { tools } from '../store/Modules/tools' - +import { toolsext } from '@src/store/Modules/toolsext' export default ({ app, store, Vue }) => { Vue.use(VueI18n) diff --git a/src/components/CDate/CDate.ts b/src/components/CDate/CDate.ts index 7bac094..6a3cb53 100644 --- a/src/components/CDate/CDate.ts +++ b/src/components/CDate/CDate.ts @@ -1,6 +1,7 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { date } from 'quasar' diff --git a/src/components/CProgress/CProgress.ts b/src/components/CProgress/CProgress.ts index cc416fd..fa736b8 100644 --- a/src/components/CProgress/CProgress.ts +++ b/src/components/CProgress/CProgress.ts @@ -2,6 +2,7 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' @Component({ name: 'CProgress' diff --git a/src/components/Header/Header.ts b/src/components/Header/Header.ts index 1f986d8..4e37eeb 100644 --- a/src/components/Header/Header.ts +++ b/src/components/Header/Header.ts @@ -8,6 +8,7 @@ import { GlobalStore, UserStore } from '@modules' // import { StateConnection } from '../../model' import { Watch } from 'vue-property-decorator' import { tools } from '../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import Quasar, { Screen } from 'quasar' diff --git a/src/components/index.ts b/src/components/index.ts index 632573b..569f93b 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -6,3 +6,6 @@ export * from './CCard' export * from './CPage' export * from './CTitle' export * from './CDate' +export * from './BannerCookies' +export * from './PagePolicy' +export * from './FormNewsletter' diff --git a/src/components/logo/logo.ts b/src/components/logo/logo.ts index d76e49d..750f71a 100644 --- a/src/components/logo/logo.ts +++ b/src/components/logo/logo.ts @@ -1,6 +1,7 @@ import Vue from 'vue' import { Component } from 'vue-property-decorator' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' @Component({ name: 'Logo' diff --git a/src/components/projects/SingleProject/SingleProject.ts b/src/components/projects/SingleProject/SingleProject.ts index 3d97981..5adc9e4 100644 --- a/src/components/projects/SingleProject/SingleProject.ts +++ b/src/components/projects/SingleProject/SingleProject.ts @@ -3,6 +3,7 @@ import { Component, Prop, Watch } from 'vue-property-decorator' import { Projects, UserStore } from '@modules' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from '../../../store/Modules/lists' import { IProject } from '../../../model/index' @@ -208,11 +209,11 @@ export default class SingleProject extends Vue { } if (this.isProject()) { - this.menuPopupProj = tools.menuPopupProj[UserStore.state.lang] + this.menuPopupProj = tools.menuPopupProj[toolsext.getLocale()] } else { this.menuPopupProj = [] - this.menuPopupProj.push(tools.menuPopupProj[UserStore.state.lang][tools.INDEX_MENU_DELETE]) + this.menuPopupProj.push(tools.menuPopupProj[toolsext.getLocale()][tools.INDEX_MENU_DELETE]) } } diff --git a/src/components/projects/SubMenusProj/SubMenusProj.ts b/src/components/projects/SubMenusProj/SubMenusProj.ts index 23a8e3e..d1987cf 100644 --- a/src/components/projects/SubMenusProj/SubMenusProj.ts +++ b/src/components/projects/SubMenusProj/SubMenusProj.ts @@ -2,6 +2,7 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from '@src/store/Modules/lists' import { UserStore } from '@store' import { IProject } from '../../../model/index' diff --git a/src/components/todos/CTodo/CTodo.ts b/src/components/todos/CTodo/CTodo.ts index 337bb18..3330e7f 100644 --- a/src/components/todos/CTodo/CTodo.ts +++ b/src/components/todos/CTodo/CTodo.ts @@ -4,6 +4,7 @@ import { Component, Prop, Watch } from 'vue-property-decorator' import { IDrag, IProject, ITodo, ITodosState } from '../../../model/index' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from '../../../store/Modules/lists' import * as ApiTables from '../../../store/Modules/ApiTables' @@ -63,11 +64,11 @@ export default class CTodo extends Vue { } get menuPopupConfigTodo() { - return tools.menuPopupConfigTodo[UserStore.state.lang] + return tools.menuPopupConfigTodo[toolsext.getLocale()] } get listOptionShowTask() { - return tools.listOptionShowTask[UserStore.state.lang] + return tools.listOptionShowTask[toolsext.getLocale()] } get TodosCount() { diff --git a/src/components/todos/SingleTodo/SingleTodo.ts b/src/components/todos/SingleTodo/SingleTodo.ts index 3fddff3..46e9a3e 100644 --- a/src/components/todos/SingleTodo/SingleTodo.ts +++ b/src/components/todos/SingleTodo/SingleTodo.ts @@ -3,6 +3,7 @@ import { Component, Prop, Watch } from 'vue-property-decorator' import { Projects, UserStore } from '@modules' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from '../../../store/Modules/lists' import { ITodo } from '../../../model/index' @@ -193,11 +194,11 @@ export default class SingleTodo extends Vue { } if (this.isTodo()) { - this.menuPopupTodo = tools.menuPopupTodo[UserStore.state.lang] + this.menuPopupTodo = tools.menuPopupTodo[toolsext.getLocale()] } else { this.menuPopupTodo = [] - this.menuPopupTodo.push(tools.menuPopupTodo[UserStore.state.lang][tools.INDEX_MENU_DELETE]) + this.menuPopupTodo.push(tools.menuPopupTodo[toolsext.getLocale()][tools.INDEX_MENU_DELETE]) } } diff --git a/src/components/todos/SubMenus/SubMenus.ts b/src/components/todos/SubMenus/SubMenus.ts index 1531fc9..bdbb3e6 100644 --- a/src/components/todos/SubMenus/SubMenus.ts +++ b/src/components/todos/SubMenus/SubMenus.ts @@ -2,6 +2,7 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from '@src/store/Modules/lists' import { UserStore } from '@store' import { ITodo } from '../../../model/index' diff --git a/src/globalroutines/indexdb.ts b/src/globalroutines/indexdb.ts index 8ad6fbb..1fa1fca 100644 --- a/src/globalroutines/indexdb.ts +++ b/src/globalroutines/indexdb.ts @@ -6,12 +6,14 @@ import { idbKeyval as storage } from '../js/storage.js' import { costanti } from '../store/Modules/costanti' import { ICfgData, IGlobalState } from '@src/model' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' + function saveConfigIndexDb(context) { const data: ICfgData = { _id: costanti.CONFIG_ID_CFG, - lang: UserStore.state.lang, + lang: toolsext.getLocale(), token: UserStore.state.x_auth_token, userId: UserStore.state.userId } diff --git a/src/globalroutines/util.ts b/src/globalroutines/util.ts index dcf670f..fad7b36 100644 --- a/src/globalroutines/util.ts +++ b/src/globalroutines/util.ts @@ -1,9 +1,9 @@ -import { UserStore } from '@modules' +import { toolsext } from '@src/store/Modules/toolsext' import messages from '../statics/i18n' function translate(params) { const msg = params.split('.') - const lang = UserStore.state.lang + const lang = toolsext.getLocale() const stringa = messages[lang] diff --git a/src/layouts/toolbar/messagePopover/messagePopover.ts b/src/layouts/toolbar/messagePopover/messagePopover.ts index a1b0b3c..a70bce7 100644 --- a/src/layouts/toolbar/messagePopover/messagePopover.ts +++ b/src/layouts/toolbar/messagePopover/messagePopover.ts @@ -6,6 +6,7 @@ import { IPost } from '../../../model/index' import './messagePopover.scss' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' @Component({ }) diff --git a/src/model/Projects.ts b/src/model/Projects.ts index 17014b1..d9b2e5e 100644 --- a/src/model/Projects.ts +++ b/src/model/Projects.ts @@ -1,6 +1,7 @@ import objectId from '@src/js/objectId' import { UserStore } from '@store' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' export interface IAction { table: string diff --git a/src/statics/i18n.js b/src/statics/i18n.js index 6b2c7b8..a70daff 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -153,14 +153,26 @@ const msgglobal = { endtime: 'alle', duration: 'Durata', hours: 'Orario', + when: 'Quando', where: 'Dove', - teacher: 'Insegnante', + teacher: 'Con', enterdate: 'Inserisci data', details: 'Dettagli', infoextra: 'Date e Ora Extra:', alldayevent: 'Tutto il giorno', eventstartdatetime: 'Data e Ora Inizio Evento', enterEndDateTime: 'Data e Ora Fine Evento' + }, + newsletter: { + name: 'Il tuo Nome', + namehint: 'Nome e Cognome', + email: 'La tua Email', + submit: 'Iscriviti', + reset: 'Cancella', + typesomething: 'Compilare correttamente il campo', + acceptlicense: 'Accetto la licenza e i termini', + license: 'Devi prima accettare la licenza e i termini', + submitted: 'Iscritto' } }, 'es': { @@ -309,14 +321,26 @@ const msgglobal = { endtime: 'fin', duration: 'Duración', hours: 'Tiempo', + when: 'Cuando', where: 'Donde', - teacher: 'Maestro', + teacher: 'Con', enterdate: 'Ingresar la fecha', details: 'Detalles', infoextra: 'Fecha y Hora Extras:', alldayevent: 'Todo el dia', eventstartdatetime: 'Evento de inicio de fecha y hora', enterEndDateTime: 'Fecha y hora del evento final' + }, + newsletter: { + name: 'Tu Nombre', + namehint: 'Nombre y Apellido', + email: 'tu correo', + submit: 'Subscribete', + reset: 'Reiniciar', + typesomething: 'Llenar el campo', + acceptlicense: 'Acepto la licencia y los términos', + license: 'Necesitas aceptar la licencia y los términos primero', + submitted: 'Subscrito' } }, 'enUs': { @@ -465,14 +489,26 @@ const msgglobal = { endtime: 'to', duration: 'Duration', hours: 'Hours', + when: 'When', where: 'Where', - teacher: 'Teacher', + teacher: 'With', enterdate: 'Enter date', details: 'Details', infoextra: 'Extra Info DateTime', alldayevent: 'All-Day event', eventstartdatetime: 'Event start date and time', enterEndDateTime: 'Event end date and time' + }, + newsletter: { + name: 'Your name', + namehint: 'Name and surname', + email: 'Your email', + submit: 'Subscribe', + reset: 'Reset', + typesomething: 'Please type something', + acceptlicense: 'I accept the license and terms', + license: 'You need to accept the license and terms first', + submitted: 'Subscribed' } }, }; diff --git a/src/store/Api/Instance.ts b/src/store/Api/Instance.ts index a826d69..fd8a4f2 100644 --- a/src/store/Api/Instance.ts +++ b/src/store/Api/Instance.ts @@ -5,6 +5,7 @@ import { clone } from 'lodash' import * as Types from './ApiTypes' import { GlobalStore, UserStore } from '@store' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { serv_constants } from '@src/store/Modules/serv_constants' export const API_URL = process.env.MONGODB_HOST diff --git a/src/store/Api/index.ts b/src/store/Api/index.ts index 05a5d05..f8f3e87 100644 --- a/src/store/Api/index.ts +++ b/src/store/Api/index.ts @@ -8,6 +8,7 @@ export { addAuthHeaders, removeAuthHeaders, API_URL } from './Instance' // import {AlgoliaSearch} from './AlgoliaController' import Paths from '@paths' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { GlobalStore, Projects, UserStore } from '@modules' import globalroutines from './../../globalroutines/index' diff --git a/src/store/Modules/ApiTables.ts b/src/store/Modules/ApiTables.ts index 32123dd..722da06 100644 --- a/src/store/Modules/ApiTables.ts +++ b/src/store/Modules/ApiTables.ts @@ -4,6 +4,7 @@ import { GlobalStore, Todos, Projects, UserStore } from '@store' import globalroutines from './../../globalroutines/index' import { serv_constants } from '@src/store/Modules/serv_constants' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' export const OtherTables = ['categories', 'config', 'swmsg'] export const MainTables = ['todos', 'projects'] @@ -126,7 +127,7 @@ async function Sync_Execute(cmd, tablesync, nametab, method, item: ITodo, id, ms console.log('ris write:', ris) const sep = '|' - const multiparams = cmdSw + sep + tablesync + sep + nametab + sep + method + sep + UserStore.state.x_auth_token + sep + UserStore.state.lang + const multiparams = cmdSw + sep + tablesync + sep + nametab + sep + method + sep + UserStore.state.x_auth_token + sep + toolsext.getLocale() const mymsgkey = { _id: multiparams, value: multiparams diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index 11b8ca5..349f70a 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -11,6 +11,7 @@ import Api from '@api' import * as Types from '@src/store/Api/ApiTypes' import { costanti } from '@src/store/Modules/costanti' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import * as ApiTables from '@src/store/Modules/ApiTables' import { GlobalStore, Projects, Todos, UserStore } from '@store' import messages from '../../statics/i18n' @@ -132,7 +133,7 @@ namespace Getters { const t = b.read((state) => (params) => { const msg = params.split('.') - const lang = UserStore.state.lang + const lang = toolsext.getLocale() const stringa = messages[lang] diff --git a/src/store/Modules/Projects.ts b/src/store/Modules/Projects.ts index ec94b3b..03fd4ee 100644 --- a/src/store/Modules/Projects.ts +++ b/src/store/Modules/Projects.ts @@ -4,6 +4,7 @@ import { storeBuilder } from './Store/Store' import Api from '@api' import { tools } from './tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from './lists' import * as ApiTables from './ApiTables' import { GlobalStore, UserStore } from '@store' diff --git a/src/store/Modules/Todos.ts b/src/store/Modules/Todos.ts index d0bab4c..1bad772 100644 --- a/src/store/Modules/Todos.ts +++ b/src/store/Modules/Todos.ts @@ -3,6 +3,7 @@ import { storeBuilder } from './Store/Store' import Api from '@api' import { tools } from './tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from './lists' import * as ApiTables from './ApiTables' import { GlobalStore, Todos, UserStore } from '@store' diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts index 27963c2..6364554 100644 --- a/src/store/Modules/UserStore.ts +++ b/src/store/Modules/UserStore.ts @@ -6,6 +6,7 @@ import router from '@router' import { serv_constants } from '../Modules/serv_constants' import { tools } from '../Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { GlobalStore, UserStore, Todos, Projects } from '@store' import globalroutines from './../../globalroutines/index' @@ -20,7 +21,7 @@ const state: IUserState = { email: '', username: '', password: '', - lang: '', + lang: process.env.LANG_DEFAULT, repeatPassword: '', tokens: [], verified_email: false, diff --git a/src/store/Modules/costanti.ts b/src/store/Modules/costanti.ts index 3d9363e..4466cac 100644 --- a/src/store/Modules/costanti.ts +++ b/src/store/Modules/costanti.ts @@ -1,3 +1,5 @@ +import { UserStore } from '@store' + export const costanti = { ShowTypeTask: { SHOW_LAST_N_COMPLETED: 200, @@ -8,5 +10,5 @@ export const costanti = { CONFIG_ID_STATE_CONN: '2', CONFIG_ID_SHOW_TYPE_TODOS: '3', - MAX_PHASES: 5 + MAX_PHASES: 5, } diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index ae81236..1260fac 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -1,6 +1,7 @@ import { Todos, Projects, UserStore } from '@store' import globalroutines from './../../globalroutines/index' import { costanti } from './costanti' +import { toolsext } from './toolsext' import { translation } from './translation' import Quasar, { date, Screen } from 'quasar' import { IListRoutes, IMenuList, IProject, ITodo, Privacy } from '@src/model' @@ -9,6 +10,7 @@ import translate from '@src/globalroutines/util' import { RouteNames } from '@src/router/route-names' import { lists } from './lists' +import { shen } from '@src/database/shen' export interface INotify { color?: string | 'primary' @@ -65,14 +67,6 @@ export const tools = { COMPLETED: 10 }, - DateFormatter: new Intl.DateTimeFormat(this.getLocale() || void 0, { - weekday: 'long', - day: 'numeric', - month: 'long', - year: 'numeric' - // timeZone: 'UTC' - }), - selectPhase: { it: [ { @@ -931,7 +925,7 @@ export const tools = { getStatusListByInd(index) { try { - const arr = tools.selectStatus[UserStore.state.lang] + const arr = tools.selectStatus[toolsext.getLocale()] for (const rec of arr) { if (rec.value === index) { return rec.label @@ -945,9 +939,9 @@ export const tools = { , getPriorityByInd(index) { - // console.log('LANG in PRIOR', UserStore.state.lang) + // console.log('LANG in PRIOR', toolsext.getLocale()) try { - const arr = lists.selectPriority[UserStore.state.lang] + const arr = lists.selectPriority[toolsext.getLocale()] for (const rec of arr) { if (rec.value === index) { return rec.label @@ -1316,6 +1310,7 @@ export const tools = { , checkLangPassed(mylang) { + console.log('checkLangPassed') const mybrowserLang = Quasar.lang.isoName @@ -1339,11 +1334,15 @@ export const tools = { if (!mylang) { mylang = process.env.LANG_DEFAULT } + + if (toolsext.getLocale(true) === '') { + UserStore.mutations.setlang(mylang) + } + console.log('mylang calc : ', mylang) return mylang - } - , + }, getimglogo() { return 'statics/images/' + process.env.LOGO_REG @@ -1816,16 +1815,20 @@ export const tools = { return val + '' }, - getLocale() { - return UserStore.state.lang + getLocale(vero?: boolean) { + if (UserStore) { + if (UserStore.state) { + return UserStore.state.lang + } + } + if (!vero) + return process.env.LANG_DEFAULT + else + return '' }, - getDateStr(mydate) { - if (this.DateFormatter && this.getLocale()) { - const date = new Date(mydate) - return this.titleFormatter.format(date) - } - return '' + addDays(mydate, days) { + return date.addToDate(mydate, { days }) } // getLocale() { diff --git a/src/views/categories/TableData/TableData.ts b/src/views/categories/TableData/TableData.ts index 9b4429d..3d0ad85 100644 --- a/src/views/categories/TableData/TableData.ts +++ b/src/views/categories/TableData/TableData.ts @@ -3,6 +3,7 @@ import { Component, Watch } from 'vue-property-decorator' import { ICategory } from '../../../model/index' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' @Component({ }) diff --git a/src/views/categories/category/category.ts b/src/views/categories/category/category.ts index 235eefe..96e7515 100644 --- a/src/views/categories/category/category.ts +++ b/src/views/categories/category/category.ts @@ -4,6 +4,7 @@ import { Component, Watch } from 'vue-property-decorator' import { SingleCat } from '../SingleCat/index' import { ICategory } from '../../../model/index' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' @Component({ diff --git a/src/views/login/requestresetpwd.vue b/src/views/login/requestresetpwd.vue index 64d986d..787f62f 100644 --- a/src/views/login/requestresetpwd.vue +++ b/src/views/login/requestresetpwd.vue @@ -64,6 +64,7 @@ import { UserStore } from "../../store/Modules"; import { IUserState } from "../../model"; import { tools } from "../../store/Modules/tools"; + import { toolsext } from '@src/store/Modules/toolsext' export default class RequestResetPwd extends Vue{ emailsent = false form: IUserState = { diff --git a/src/views/login/signin/signin.ts b/src/views/login/signin/signin.ts index 5c5f67f..787f93b 100644 --- a/src/views/login/signin/signin.ts +++ b/src/views/login/signin/signin.ts @@ -3,6 +3,7 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { serv_constants } from '../../../store/Modules/serv_constants' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { ISigninOptions, IUserState } from 'model' import { TSignin, validations } from './signin-validate' @@ -161,14 +162,14 @@ export default class Signin extends Vue { } return riscode }).then((riscode) => { - if (UserStore.state.lang !== '') { - this.$i18n.locale = UserStore.state.lang + if (toolsext.getLocale() !== '') { + this.$i18n.locale = toolsext.getLocale() } // Set Lang else { UserStore.mutations.setlang(this.$i18n.locale) } // Set Lang - // console.log('LANG ORA=', UserStore.state.lang) + // console.log('LANG ORA=', toolsext.getLocale()) globalroutines(this, 'loadapp', '') return riscode diff --git a/src/views/login/signup/signup.ts b/src/views/login/signup/signup.ts index 656ed09..45ac6ca 100644 --- a/src/views/login/signup/signup.ts +++ b/src/views/login/signup/signup.ts @@ -2,6 +2,7 @@ import Vue from 'vue' import { Component, Prop, Watch } from 'vue-property-decorator' import { UserStore } from '@store' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { ISignupOptions, IUserState } from 'model' import { validations, TSignup } from './signup-validate' diff --git a/src/views/login/updatepassword.vue b/src/views/login/updatepassword.vue index 015be67..418df46 100644 --- a/src/views/login/updatepassword.vue +++ b/src/views/login/updatepassword.vue @@ -76,6 +76,7 @@ import { UserStore } from "../../store/Modules"; import { IUserState } from "../../model"; import { tools } from "../../store/Modules/tools"; + import { toolsext } from '@src/store/Modules/toolsext' export default class UpdatePassword extends Vue { emailsent = false diff --git a/src/views/projects/proj-list/proj-list.ts b/src/views/projects/proj-list/proj-list.ts index 5c32d76..a6adc0f 100644 --- a/src/views/projects/proj-list/proj-list.ts +++ b/src/views/projects/proj-list/proj-list.ts @@ -6,6 +6,7 @@ import { SingleProject } from '../../../components/projects/SingleProject/index' import { CTodo } from '../../../components/todos/CTodo' import { tools } from '../../../store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' import { lists } from '../../../store/Modules/lists' import * as ApiTables from '../../../store/Modules/ApiTables' @@ -56,9 +57,9 @@ export default class ProjList extends Vue { public percProgress: string = 'percProgress' public readonly: boolean = false - public selectStatus: [] = tools.selectStatus[UserStore.state.lang] - public selectPhase: [] = tools.selectPhase[UserStore.state.lang] - public selectPrivacy: [] = tools.selectPrivacy[UserStore.state.lang] + public selectStatus: [] = tools.selectStatus[toolsext.getLocale()] + public selectPhase: [] = tools.selectPhase[toolsext.getLocale()] + public selectPrivacy: [] = tools.selectPrivacy[toolsext.getLocale()] public $refs: { singleproject: SingleProject[], @@ -203,9 +204,9 @@ export default class ProjList extends Vue { get menuPopupConfigProject() { let mymenu = null if (this.isMainProject) - mymenu = tools.menuPopupConfigMAINProject[UserStore.state.lang] + mymenu = tools.menuPopupConfigMAINProject[toolsext.getLocale()] else - mymenu = tools.menuPopupConfigProject[UserStore.state.lang] + mymenu = tools.menuPopupConfigProject[toolsext.getLocale()] if (mymenu.length > 0) mymenu[0].disable = !(GlobalStore.state.lastaction.type === lists.MenuAction.CUT) @@ -214,7 +215,7 @@ export default class ProjList extends Vue { } get listOptionShowTask() { - return tools.listOptionShowTask[UserStore.state.lang] + return tools.listOptionShowTask[toolsext.getLocale()] } get descrProject() { diff --git a/src/views/todo-list/todo-list.ts b/src/views/todo-list/todo-list.ts index 24f08ce..87dfc5b 100644 --- a/src/views/todo-list/todo-list.ts +++ b/src/views/todo-list/todo-list.ts @@ -2,6 +2,7 @@ import Vue from 'vue' import { Component, Watch } from 'vue-property-decorator' import { CTodo } from '@src/components/todos/CTodo' import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' @Component({ components: { CTodo },