PASSAGGIO A VITE !

AGG. 1.1.23
This commit is contained in:
Surya Paolo
2025-03-01 14:14:43 +01:00
parent f0098e57b2
commit bc960d38a1
1044 changed files with 5323 additions and 10823777 deletions

View File

@@ -1,11 +1,11 @@
import { date, useQuasar } from 'quasar'
import { useUserStore } from '@store/UserStore'
// import { useGlobalStore } from '@store/globalStore'
import { static_data } from '@/db/static_data'
import { static_data } from '@src/db/static_data'
import { useGlobalStore } from '@store/globalStore'
import { useTodoStore } from '@store/Todos'
import { Router } from 'vue-router'
import { ISpecialField } from 'model'
import type { Router } from 'vue-router'
import type { ISpecialField } from 'model'
export const func_tools = {
getLocale(vero?: boolean): string {
@@ -13,7 +13,7 @@ export const func_tools = {
if (userStore) {
return userStore.lang
}
if (!vero) return process.env.LANG_DEFAULT ? process.env.LANG_DEFAULT : 'it'
if (!vero) return import.meta.env.VITE_LANG_DEFAULT ? import.meta.env.VITE_LANG_DEFAULT : 'it'
return ''
},
@@ -134,7 +134,7 @@ export const toolsext = {
if (userStore) {
return userStore.lang
}
return process.env.LANG_DEFAULT ? process.env.LANG_DEFAULT : 'it'
return import.meta.env.VITE_LANG_DEFAULT ? import.meta.env.VITE_LANG_DEFAULT : 'it'
},
isLang(whichlang: string): boolean {
const loc = func_tools.getLocale()
@@ -144,26 +144,6 @@ export const toolsext = {
if (mylang === 'enUs') return 'en-us'
return mylang
},
setLangAtt($q: any, $router: Router, mylang: string) {
const globalStore = useGlobalStore()
// console.log('setLangAtt =', mylang)
// console.log('PRIMA this.$q.lang.isoName', this.$q.lang.isoName)
// dynamic import, so loading on demand only
import(`quasar/lang/${this.getlangforQuasar(mylang)}`).then((lang) => {
// console.log(' Import dinamically lang =', lang)
$q.lang.set(this.getlangforQuasar(lang.default.isoName))
import('../../statics/i18n').then(() => {
// console.log(' *** MY LANG DOPO=', $q.lang.isoName)
})
})
globalStore.addDynamicPages($router)
// this.$q.lang.set(mylang)
},
getValDb(keystr: string, serv: boolean, def?: any, table?: string, subkey?: string, id?: any, idmain?: any, indrec?: number, subsubkey?: string, specialField?: ISpecialField): any {
@@ -285,7 +265,7 @@ export const toolsext = {
}
if (!mylang) {
if (process.env.LANG_DEFAULT) mylang = process.env.LANG_DEFAULT
if (import.meta.env.VITE_LANG_DEFAULT) mylang = import.meta.env.VITE_LANG_DEFAULT
console.log('LANG DEFAULT: ', mylang)
}