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) {
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 scoreSum = computed(() => {
@ -154,15 +155,6 @@ async function share() {
saveAs(dataUrl, `Ceiba-score-${fileName}.png`);
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>
<template>
@ -191,20 +183,20 @@ const trad = store.language == "fr-FR" ? {
<SplideSlide class="latest">
<template v-if="displayScoreResult && result">
<div>
<h2 class="center">{{ trad.failure }}</h2>
<h2 class="center">{{ trad.result_title }}</h2>
<h2 class="center">{{ result.pde_qtra }}</h2>
<div class="gradient">
<div
v-for="(item, index) in [...Array(7).keys()]"
:class="{ active: result && result.pde_qtra === index + 1 }"
:key="item"
:data-title=trad.sigle
:data-title=trad.result_sigle
>
{{ index + 1 }}
</div>
</div>
<div class="details">
<p>{{ trad.params }} :</p>
<p>{{ trad.result_params }} :</p>
<ul>
<li v-for="question in questions" :key="question.id">
{{ question.title }} :