From 79a0ab2a1ae3ad79c36917610631c53252df3ac2 Mon Sep 17 00:00:00 2001 From: Simon C Date: Thu, 15 Feb 2024 09:33:57 +0100 Subject: [PATCH] feat: Ajout de la traduction du titre dans la vue d'un scrore --- src/components/Score.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Score.vue b/src/components/Score.vue index 40fd460..e0cfb37 100644 --- a/src/components/Score.vue +++ b/src/components/Score.vue @@ -58,8 +58,10 @@ function formatScore(score) { }; }); } - -const title = score ? score.title : ""; +function getTranslation(translations, key) { + return translations.find((translation) => translation[key] == store.language); +} +const title = score ? getTranslation(score.translations, "languages_id").title : ""; const questions = ref(formatScore(score)); const scoreSum = computed(() => {