feat: add i18n support and implement Grafana plugin
Adds internationalization support in filters and origins pages by importing the useI18n function. Expands ESLint configuration to include new rules and plugins, ensuring improved code quality. Introduces Grafana monitoring plugin to enhance performance tracking capabilities in the application.
This commit is contained in:
@@ -6,11 +6,10 @@
|
||||
v-if="hasUser"
|
||||
class="ml-1 mr-1 text-medium-emphasis"
|
||||
size="small"
|
||||
title="Dölj"
|
||||
:title="t('events.hide')"
|
||||
icon='mdi-eye-off'
|
||||
@click="toggleIgnore('band', event.band.name)"
|
||||
>
|
||||
mdi-eye-off
|
||||
</v-icon>
|
||||
/>
|
||||
{{ event.band.name }}
|
||||
</h3>
|
||||
</v-card-title>
|
||||
@@ -21,13 +20,13 @@
|
||||
xs="12"
|
||||
sm="6"
|
||||
>
|
||||
<strong class="mr-1" v-text="$t('events.date')" />{{
|
||||
<strong class="mr-1" v-text="t('events.date')" />{{
|
||||
event.date
|
||||
}}
|
||||
({{ weekday }} {{ daysUntil }})
|
||||
</v-col>
|
||||
<v-col v-if="event.time" cols="12" xs="12" sm="6">
|
||||
<strong class="mr-1" v-text="$t('events.time')" />{{
|
||||
<strong class="mr-1" v-text="t('events.time')" />{{
|
||||
event.time
|
||||
}}
|
||||
</v-col>
|
||||
@@ -38,16 +37,15 @@
|
||||
xs="12"
|
||||
sm="6"
|
||||
>
|
||||
<strong class="mr-1" v-text="$t('events.hall')" />
|
||||
<strong class="mr-1" v-text="t('events.hall')" />
|
||||
<v-icon
|
||||
v-if="hasUser"
|
||||
class="ml-1 mr-1 text-medium-emphasis"
|
||||
size="small"
|
||||
:title="$t('events.hide')"
|
||||
:title="t('events.hide')"
|
||||
icon='mdi-eye-off'
|
||||
@click="toggleIgnore('danceHall', event.danceHall.name)"
|
||||
>
|
||||
mdi-eye-off
|
||||
</v-icon>
|
||||
/>
|
||||
{{ event.danceHall.name }}
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -55,16 +53,15 @@
|
||||
xs="12"
|
||||
sm="6"
|
||||
>
|
||||
<strong class="mr-1" v-text="$t('events.city')" />
|
||||
<strong class="mr-1" v-text="t('events.city')" />
|
||||
<v-icon
|
||||
v-if="hasUser"
|
||||
class="ml-1 mr-1 text-medium-emphasis"
|
||||
size="small"
|
||||
:title="$t('events.hide')"
|
||||
:title="t('events.hide')"
|
||||
icon='mdi-eye-off'
|
||||
@click="toggleIgnore('city', event.danceHall.city)"
|
||||
>
|
||||
mdi-eye-off
|
||||
</v-icon>
|
||||
/>
|
||||
{{ event.danceHall.city }}
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -72,18 +69,17 @@
|
||||
xs="12"
|
||||
sm="6"
|
||||
>
|
||||
<strong class="mr-1" v-text="$t('events.municipality')" />
|
||||
<strong class="mr-1" v-text="t('events.municipality')" />
|
||||
<v-icon
|
||||
v-if="hasUser"
|
||||
class="ml-1 mr-1 text-medium-emphasis"
|
||||
size="small"
|
||||
:title="$t('events.hide')"
|
||||
:title="t('events.hide')"
|
||||
icon='mdi-eye-off'
|
||||
@click="
|
||||
toggleIgnore('municipality', event.danceHall.municipality)
|
||||
"
|
||||
>
|
||||
mdi-eye-off
|
||||
</v-icon>
|
||||
/>
|
||||
{{ event.danceHall.municipality }}
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -91,16 +87,15 @@
|
||||
xs="12"
|
||||
sm="6"
|
||||
>
|
||||
<strong class="mr-1" v-text="$t('events.state')" />
|
||||
<strong class="mr-1" v-text="t('events.state')" />
|
||||
<v-icon
|
||||
v-if="hasUser"
|
||||
class="ml-1 mr-1 text-medium-emphasis"
|
||||
size="small"
|
||||
:title="$t('events.hide')"
|
||||
:title="t('events.hide')"
|
||||
icon='mdi-eye-off'
|
||||
@click="toggleIgnore('state', event.danceHall.state)"
|
||||
>
|
||||
mdi-eye-off
|
||||
</v-icon>
|
||||
/>
|
||||
{{ event.danceHall.state }}
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -112,12 +107,12 @@
|
||||
<script setup lang='ts'>
|
||||
|
||||
import { format, formatDistanceToNow, parseISO } from 'date-fns'
|
||||
|
||||
import { enGB, sv } from 'date-fns/locale'
|
||||
import { computed, type PropType } from 'vue'
|
||||
|
||||
import { useI18n } from '#i18n'
|
||||
import type { Event } from '~/graphql/generated/operations'
|
||||
import DistanceDisplay from '~/components/pages/events/event-distance.vue'
|
||||
import type { Event } from '~/graphql/generated/operations'
|
||||
|
||||
const props = defineProps({
|
||||
event: {
|
||||
@@ -133,7 +128,7 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
const { locale: currentLocale } = useI18n()
|
||||
const { t, locale: currentLocale } = useI18n()
|
||||
const locale = computed(() => (currentLocale.value ?? 'sv') === 'en' ? enGB : sv)
|
||||
const time = computed(() => (props.event.time || '').split('-')[0].replace('.', ':'))
|
||||
const weekday = computed(() => format(parseISO(props.event.date), 'EEEE', { locale: locale.value }))
|
||||
|
||||
Reference in New Issue
Block a user