- Installation vue-i18n v11 et création des fichiers de traduction (fr.json, en.json) - Création store locale avec détection hiérarchique (URL > localStorage > navigator) - Modification des routes avec préfixe /:locale? optionnel - Toggle FR/EN dans Menu.vue avec synchronisation immédiate - Traduction de ~200 textes dans 27 composants Vue - Suppression des labels hardcodés en français côté backend - Ajout route Kirby catch-all en/(:all?) pour /en/ URLs - Helper addLocalePrefix() pour préserver locale dans liens dialogs - Traduction pseudo-élément CSS via data attribute Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
62 lines
1.7 KiB
Vue
62 lines
1.7 KiB
Vue
<template>
|
|
<article
|
|
@click="read()"
|
|
v-if="useUserStore.role !== 'client'"
|
|
class="notification | bg-white rounded-lg | p-16 | flow"
|
|
data-type="project-request"
|
|
>
|
|
<header>
|
|
<p class="flex">
|
|
<strong
|
|
class="notification__type | font-medium text-primary"
|
|
data-icon="document"
|
|
>{{ t('notifications.projectRequest') }}</strong
|
|
>
|
|
<span class="notification__client | text-grey-700"
|
|
>{{ notification.project.title }}
|
|
{{
|
|
notification.project.status === "draft" ? t('notifications.draft') : ""
|
|
}}</span
|
|
>
|
|
<time
|
|
datetime=""
|
|
class="notification__date | text-grey-700 | ml-auto"
|
|
>{{ formatDate(notification) }}</time
|
|
>
|
|
</p>
|
|
</header>
|
|
<p
|
|
v-if="notification.type"
|
|
class="notification__body | text-md font-medium | line-clamp"
|
|
v-html="
|
|
t('notifications.from') + ' ' +
|
|
(notification.author.name
|
|
? notification.author.name + ' (' + notification.author.email + ')'
|
|
: notification.author.email) +
|
|
' : <br>' +
|
|
notification.text
|
|
"
|
|
></p>
|
|
</article>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { useNotificationsStore } from "../../stores/notifications";
|
|
import { useUserStore } from "../../stores/user";
|
|
import { useApiStore } from "../../stores/api";
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
const { t } = useI18n();
|
|
|
|
const { notification } = defineProps({ notification: Object });
|
|
const { formatDate } = useNotificationsStore();
|
|
const { user } = useUserStore();
|
|
const api = useApiStore();
|
|
|
|
async function read() {
|
|
const response = await api.readNotification(
|
|
notification.id,
|
|
notification.project.uri
|
|
);
|
|
}
|
|
</script>
|