fix language switching close #51
This commit is contained in:
@@ -170,3 +170,30 @@ week: Wuche
|
|||||||
month: Monat
|
month: Monat
|
||||||
year: Jahr
|
year: Jahr
|
||||||
appName: Applikationsname
|
appName: Applikationsname
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Suntig'
|
||||||
|
- 'Mäntig'
|
||||||
|
- 'Zistig'
|
||||||
|
- 'Mittwuch'
|
||||||
|
- 'Donstig'
|
||||||
|
- 'Fritig'
|
||||||
|
- 'Samstig'
|
||||||
|
daysShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa']
|
||||||
|
months:
|
||||||
|
- 'Januar'
|
||||||
|
- 'Februar'
|
||||||
|
- 'März'
|
||||||
|
- 'April'
|
||||||
|
- 'Mai'
|
||||||
|
- 'Juni'
|
||||||
|
- 'Juli'
|
||||||
|
- 'Ougust'
|
||||||
|
- 'Septämber'
|
||||||
|
- 'Oktober'
|
||||||
|
- 'Novämber'
|
||||||
|
- 'Dezämber'
|
||||||
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']
|
||||||
|
firstDayOfWeek: 1
|
||||||
|
format24h: true
|
||||||
|
pluralDay: 'Täg'
|
||||||
|
|||||||
@@ -132,20 +132,6 @@ filterByColumn: Spaltenfilter
|
|||||||
filterByColumnValue: Spaltenwerte
|
filterByColumnValue: Spaltenwerte
|
||||||
saveAsDefault: Als Standard speichern
|
saveAsDefault: Als Standard speichern
|
||||||
day: Tag
|
day: Tag
|
||||||
Monday: Montag
|
|
||||||
MondayShort: Mo
|
|
||||||
Tuesday: Dienstag
|
|
||||||
TuesdayShort: Di
|
|
||||||
Wednesday: Mittwoch
|
|
||||||
WednesdayShort: Mi
|
|
||||||
Thursday: Donnerstag
|
|
||||||
ThursdayShort: Do
|
|
||||||
Friday: Freitag
|
|
||||||
FridayShort: Fr
|
|
||||||
Saturday: Samstag
|
|
||||||
SaturdayShort: Sa
|
|
||||||
Sunday: Sonntag
|
|
||||||
SundayShort: So
|
|
||||||
currentPassword: Aktuelles Passwort
|
currentPassword: Aktuelles Passwort
|
||||||
addFirstUser: Füge erster Admin Benutzer hinzu
|
addFirstUser: Füge erster Admin Benutzer hinzu
|
||||||
report: Rapport
|
report: Rapport
|
||||||
@@ -170,3 +156,30 @@ week: Woche
|
|||||||
month: Monat
|
month: Monat
|
||||||
year: Jahr
|
year: Jahr
|
||||||
appName: Applikationsname
|
appName: Applikationsname
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Sonntag'
|
||||||
|
- 'Montag'
|
||||||
|
- 'Dienstag'
|
||||||
|
- 'Mittwoch'
|
||||||
|
- 'Donnerstag'
|
||||||
|
- 'Freitag'
|
||||||
|
- 'Samstag'
|
||||||
|
daysShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa']
|
||||||
|
months:
|
||||||
|
- 'Januar'
|
||||||
|
- 'Februar'
|
||||||
|
- 'März'
|
||||||
|
- 'April'
|
||||||
|
- 'Mai'
|
||||||
|
- 'Juni'
|
||||||
|
- 'Juli'
|
||||||
|
- 'August'
|
||||||
|
- 'September'
|
||||||
|
- 'Oktober'
|
||||||
|
- 'November'
|
||||||
|
- 'Dezember'
|
||||||
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']
|
||||||
|
firstDayOfWeek: 1
|
||||||
|
format24h: true
|
||||||
|
pluralDay: 'Tage'
|
||||||
|
|||||||
@@ -170,3 +170,30 @@ week: Week
|
|||||||
month: Month
|
month: Month
|
||||||
year: Year
|
year: Year
|
||||||
appName: Applicationname
|
appName: Applicationname
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Sunday'
|
||||||
|
- 'Monday'
|
||||||
|
- 'Tuesday'
|
||||||
|
- 'Wednesday'
|
||||||
|
- 'Thursday'
|
||||||
|
- 'Friday'
|
||||||
|
- 'Saturday'
|
||||||
|
daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat']
|
||||||
|
months:
|
||||||
|
- 'January'
|
||||||
|
- 'February'
|
||||||
|
- 'March'
|
||||||
|
- 'April'
|
||||||
|
- 'May'
|
||||||
|
- 'June'
|
||||||
|
- 'July'
|
||||||
|
- 'August'
|
||||||
|
- 'September'
|
||||||
|
- 'October'
|
||||||
|
- 'November'
|
||||||
|
- 'December'
|
||||||
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||||
|
firstDayOfWeek: 0
|
||||||
|
format24h: false
|
||||||
|
pluralDay: 'Days'
|
||||||
|
|||||||
@@ -170,3 +170,30 @@ week: Semana
|
|||||||
month: Mes
|
month: Mes
|
||||||
year: Año
|
year: Año
|
||||||
appName: Nombre de la aplicación
|
appName: Nombre de la aplicación
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Domingo'
|
||||||
|
- 'Lunes'
|
||||||
|
- 'Martes'
|
||||||
|
- 'Miércoles'
|
||||||
|
- 'Jueves'
|
||||||
|
- 'Viernes'
|
||||||
|
- 'Sábado'
|
||||||
|
daysShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb']
|
||||||
|
months:
|
||||||
|
- 'Enero'
|
||||||
|
- 'Febrero'
|
||||||
|
- 'Marzo'
|
||||||
|
- 'Abril'
|
||||||
|
- 'Mayo'
|
||||||
|
- 'Junio'
|
||||||
|
- 'Julio'
|
||||||
|
- 'Agosto'
|
||||||
|
- 'Septiembre'
|
||||||
|
- 'Octubre'
|
||||||
|
- 'Noviembre'
|
||||||
|
- 'Diciembre'
|
||||||
|
monthsShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic']
|
||||||
|
firstDayOfWeek: 1
|
||||||
|
format24h: true
|
||||||
|
pluralDay: 'dias'
|
||||||
|
|||||||
@@ -31,16 +31,16 @@
|
|||||||
</q-tabs>
|
</q-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<q-date v-model="dateRange" range flat />
|
<q-date :locale="calendarLanguage" v-model="dateRange" range flat />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch, type PropType } from 'vue';
|
import { ref, onMounted, watch, type PropType, computed } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { i18n } from 'src/boot/lang';
|
import { i18n } from 'src/boot/lang';
|
||||||
|
import type { QDateLocale } from 'src/vueLib/models/qDateLocale';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: String,
|
title: String,
|
||||||
height: { type: Number, default: 400 },
|
height: { type: Number, default: 400 },
|
||||||
@@ -74,6 +74,20 @@ const weekdayOptions = [
|
|||||||
{ label: i18n.global.t('SundayShort'), value: 0 },
|
{ label: i18n.global.t('SundayShort'), value: 0 },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const calendarLanguage = computed(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||||
|
const localeData = i18n.global.tm('calendar') as unknown as QDateLocale;
|
||||||
|
return {
|
||||||
|
days: localeData.days,
|
||||||
|
daysShort: localeData.daysShort,
|
||||||
|
months: localeData.months,
|
||||||
|
monthsShort: localeData.monthsShort,
|
||||||
|
firstDayOfWeek: localeData.firstDayOfWeek,
|
||||||
|
format24h: localeData.format24h,
|
||||||
|
pluralDay: localeData.pluralDay,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const onTabChange = (val: 'today' | 'week' | 'month' | 'year') => {
|
const onTabChange = (val: 'today' | 'week' | 'month' | 'year') => {
|
||||||
if (val) setRange(val);
|
if (val) setRange(val);
|
||||||
// Optional: Reset tab to empty so user can click the same tab again later
|
// Optional: Reset tab to empty so user can click the same tab again later
|
||||||
|
|||||||
9
src/vueLib/models/qDateLocale.ts
Normal file
9
src/vueLib/models/qDateLocale.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export interface QDateLocale {
|
||||||
|
days: string[];
|
||||||
|
daysShort: string[];
|
||||||
|
months: string[];
|
||||||
|
monthsShort: string[];
|
||||||
|
firstDayOfWeek: number;
|
||||||
|
format24h: boolean;
|
||||||
|
pluralDay: string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user