Complete dashboard translations & small UI improvements (#69)

* fix dropdown action Estimate Dashboard and fix translating full Dasboard page

* Update app.php

* fix locale in app.php config

* Wizard install with translation, customer portal with translation, and fixing hardcoding strings to get translation

* fixes asked to review

* fixes pint

---------

Co-authored-by: Max <contact@agencetwogether.fr>
Co-authored-by: Darko Gjorgjijoski <5760249+gdarko@users.noreply.github.com>
This commit is contained in:
agencetwogether
2024-06-05 12:07:46 +02:00
committed by GitHub
parent 3259173066
commit 3b61440e1f
89 changed files with 925 additions and 213 deletions

View File

@@ -49,8 +49,39 @@
<script type="text/babel" setup>
import FlatPickr from 'vue-flatpickr-component'
import 'flatpickr/dist/flatpickr.css'
import { Arabic } from 'flatpickr/dist/l10n/ar.js'
import { Czech } from 'flatpickr/dist/l10n/cs.js'
import { German } from 'flatpickr/dist/l10n/de.js'
import { Greek } from 'flatpickr/dist/l10n/gr.js'
import { english } from 'flatpickr/dist/l10n/default.js'
import { Spanish } from 'flatpickr/dist/l10n/es.js'
import { Persian } from 'flatpickr/dist/l10n/fa.js'
import { Finnish } from 'flatpickr/dist/l10n/fi.js'
import { French } from 'flatpickr/dist/l10n/fr.js'
import { Hindi } from 'flatpickr/dist/l10n/hi.js'
import { Croatian } from 'flatpickr/dist/l10n/hr.js'
import { Indonesian } from 'flatpickr/dist/l10n/id.js'
import { Italian } from 'flatpickr/dist/l10n/it.js'
import { Japanese } from 'flatpickr/dist/l10n/ja.js'
import { Korean } from 'flatpickr/dist/l10n/ko.js'
import { Lithuanian } from 'flatpickr/dist/l10n/lt.js'
import { Latvian } from 'flatpickr/dist/l10n/lv.js'
import { Dutch } from 'flatpickr/dist/l10n/nl.js'
import { Polish } from 'flatpickr/dist/l10n/pl.js'
import { Portuguese } from 'flatpickr/dist/l10n/pt.js'
import { Romanian } from 'flatpickr/dist/l10n/ro.js'
import { Russian } from 'flatpickr/dist/l10n/ru.js'
import { Slovak } from 'flatpickr/dist/l10n/sk.js'
import { Slovenian } from 'flatpickr/dist/l10n/sl.js'
import { Serbian } from 'flatpickr/dist/l10n/sr.js'
import { Swedish } from 'flatpickr/dist/l10n/sv.js'
import { Thai } from 'flatpickr/dist/l10n/th.js'
import { Turkish } from 'flatpickr/dist/l10n/tr.js'
import { Vietnamese } from 'flatpickr/dist/l10n/vn.js'
import { Mandarin } from 'flatpickr/dist/l10n/zh.js'
import { computed, reactive, watch, ref, useSlots } from 'vue'
import { useCompanyStore } from '@/scripts/admin/stores/company'
import { useUserStore } from '@/scripts/admin/stores/user'
const dp = ref(null)
@@ -104,10 +135,112 @@ const slots = useSlots()
const companyStore = useCompanyStore()
const userStore = useUserStore()
//Localize Flatpicker stuff
const lang = userStore.currentUserSettings.language
let fpLocale = null
switch(lang){
case 'ar':
fpLocale = Arabic;
break;
case 'cs':
fpLocale = Czech;
break;
case 'de':
fpLocale = German;
break;
case 'el':
fpLocale = Greek;
break;
case 'en':
fpLocale = english;
break;
case 'es':
fpLocale = Spanish;
break;
case 'fa':
fpLocale = Persian;
break;
case 'fi':
fpLocale = Finnish;
break;
case 'fr':
fpLocale = French;
break;
case 'hi':
fpLocale = Hindi;
break;
case 'hr':
fpLocale = Croatian;
break;
case 'id':
fpLocale = Indonesian;
break;
case 'it':
fpLocale = Italian;
break;
case 'ja':
fpLocale = Japanese;
break;
case 'ko':
fpLocale = Korean;
break;
case 'lt':
fpLocale = Lithuanian;
break;
case 'lv':
fpLocale = Latvian;
break;
case 'nl':
fpLocale = Dutch;
break;
case 'pl':
fpLocale = Polish;
break;
case 'pt':
case 'pt_BR':
fpLocale = Portuguese;
break;
case 'ro':
fpLocale = Romanian;
break;
case 'ru':
fpLocale = Russian;
break;
case 'sk':
fpLocale = Slovak;
break;
case 'sl':
fpLocale = Slovenian;
break;
case 'sr':
fpLocale = Serbian;
break;
case 'sv':
fpLocale = Swedish;
break;
case 'th':
fpLocale = Thai;
break;
case 'tr':
fpLocale = Turkish;
break;
case 'vi':
fpLocale = Vietnamese;
break;
case 'zh':
fpLocale = Mandarin;
break;
default:
fpLocale = english;
}
let config = reactive({
altInput: true,
enableTime: props.enableTime,
time_24hr: props.time24hr,
locale: fpLocale
})
const date = computed({