First Committ

This commit is contained in:
Paolo Arena
2021-08-31 18:09:59 +02:00
commit 1d6c55807c
299 changed files with 55382 additions and 0 deletions

25
src/globalroutines/util.ts Executable file
View File

@@ -0,0 +1,25 @@
import { toolsext } from '@src/store/Modules/toolsext'
import { tools } from '@src/store/Modules/tools'
import messages from '../statics/i18n'
function translate(params: any) {
const msg = params.split('.')
const lang = toolsext.getLocale()
// @ts-ignore
const stringa = messages[lang]
let ris = stringa
if (ris) {
msg.forEach((param: any) => {
ris = ris[param]
})
} else {
console.log('ERRORE IN TRANSLATE! ', params, ' NON ESISTE!')
return params
}
return ris
}
export default translate