feat: Ajout des traductions depuis l'administration
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is passing Details

This commit is contained in:
Simon 2024-02-15 10:16:37 +01:00
parent 2bcddaabcf
commit d2f5d7d840
1 changed files with 5 additions and 13 deletions

View File

@ -61,7 +61,8 @@ function formatScore(score) {
function getTranslation(translations, key) { function getTranslation(translations, key) {
return translations.find((translation) => translation[key] == store.language); return translations.find((translation) => translation[key] == store.language);
} }
const title = score ? getTranslation(score.translations, "languages_id").title : ""; const trad = getTranslation(score.translations, "languages_id")
const title = score ? trad.title : "";
const questions = ref(formatScore(score)); const questions = ref(formatScore(score));
const scoreSum = computed(() => { const scoreSum = computed(() => {
@ -154,15 +155,6 @@ async function share() {
saveAs(dataUrl, `Ceiba-score-${fileName}.png`); saveAs(dataUrl, `Ceiba-score-${fileName}.png`);
sharing.value = false; sharing.value = false;
} }
const trad = store.language == "fr-FR" ? {
"failure": "Probabilité d'échec",
"params": "Rappel des paramètres choisis",
"sigle": "PdE",
} : {
"failure": "Likelihood of Failure",
"params": "Chosen parameters",
"sigle": "LoF",
}
</script> </script>
<template> <template>
@ -191,20 +183,20 @@ const trad = store.language == "fr-FR" ? {
<SplideSlide class="latest"> <SplideSlide class="latest">
<template v-if="displayScoreResult && result"> <template v-if="displayScoreResult && result">
<div> <div>
<h2 class="center">{{ trad.failure }}</h2> <h2 class="center">{{ trad.result_title }}</h2>
<h2 class="center">{{ result.pde_qtra }}</h2> <h2 class="center">{{ result.pde_qtra }}</h2>
<div class="gradient"> <div class="gradient">
<div <div
v-for="(item, index) in [...Array(7).keys()]" v-for="(item, index) in [...Array(7).keys()]"
:class="{ active: result && result.pde_qtra === index + 1 }" :class="{ active: result && result.pde_qtra === index + 1 }"
:key="item" :key="item"
:data-title=trad.sigle :data-title=trad.result_sigle
> >
{{ index + 1 }} {{ index + 1 }}
</div> </div>
</div> </div>
<div class="details"> <div class="details">
<p>{{ trad.params }} :</p> <p>{{ trad.result_params }} :</p>
<ul> <ul>
<li v-for="question in questions" :key="question.id"> <li v-for="question in questions" :key="question.id">
{{ question.title }} : {{ question.title }} :