Skip to content

Commit

Permalink
Revise single dim indicator total wording
Browse files Browse the repository at this point in the history
  • Loading branch information
terotik committed Nov 27, 2024
1 parent de8c7d3 commit 054427f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 3 deletions.
18 changes: 15 additions & 3 deletions components/indicators/IndicatorVisualisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,22 @@ function generateCubeFromValues(
return generateCube(indicatorGraphSpecification.dimensions, values);
}

function getTraces(dimensions, cube, names, hasTimeDimension, i18n) {
function getTraces(
dimensions,
cube,
names,
hasTimeDimension,
i18n,
quantityName
) {
// TODO: We could use quantity name but we can not tell if it's in the correct language
// const name = capitalizeFirstLetter(quantityName ?? i18n.t('value'));
const name = capitalizeFirstLetter(i18n.t('value'));
if (dimensions.length === 0) {
return [
{
xType: cube.length === 1 ? 'category' : 'time',
name: i18n.t('total'),
name: name,
dataType: 'total',
x: cube.map((val) => {
const d = dayjs(val.date);
Expand Down Expand Up @@ -599,6 +609,7 @@ function IndicatorVisualisation({ indicatorId, indicatorLink }) {
plan: { scenarios },
} = data;

console.log('indicator', data);
if (!indicator)
return <Alert color="danger">{t('indicator-not-found')}</Alert>;

Expand Down Expand Up @@ -684,7 +695,8 @@ function IndicatorVisualisation({ indicatorId, indicatorLink }) {
cube,
null,
hasTimeDimension,
i18n
i18n,
indicator.quantity?.name
);
const [goalTraces, goalBounds] = normalizeByPopulation
? [[], []]
Expand Down
1 change: 1 addition & 0 deletions locales/da/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"themes": "Temaer",
"to-reduce": "Skal reduceres",
"total": "I alt",
"value": "værdi",
"type": "Type",
"under-relative-time": "Under {relativeTime}",
"updated": "Opdateret",
Expand Down
1 change: 1 addition & 0 deletions locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"themes": "Themen",
"to-reduce": "Noch zu reduzieren",
"total": "Gesamtwert",
"value": "Ist-Wert",
"type": "Typ",
"under-relative-time": "Weniger als {relativeTime}",
"updated": "Aktualisiert",
Expand Down
1 change: 1 addition & 0 deletions locales/el/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"supported-by": "Υποστηρίζεται από",
"tactical-indicator": "Τακτικός δείκτης",
"total": "σύνολο",
"value": "τιμή",
"type": "Τύπος",
"updated": "Ενημερωμένο",
"see-all-actions": "{context, select, CASE_STUDY {Δείτε όλες τις μελέτες περιπτώσεων} STRATEGY {Δείτε όλες τις στρατηγικές} other {Δείτε όλες τις δράσεις}}",
Expand Down
1 change: 1 addition & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"themes": "Themes",
"to-reduce": "Left to reduce",
"total": "total",
"value": "Value",
"type": "Type",
"under-relative-time": "Under {relativeTime}",
"updated": "Updated",
Expand Down
1 change: 1 addition & 0 deletions locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"themes": "Temas",
"to-reduce": "Izquierda para reducir",
"total": "total",
"value": "valor",
"type": "Tipo",
"under-relative-time": "Menos de {relativeTime}",
"updated": "Actualizado",
Expand Down
1 change: 1 addition & 0 deletions locales/fi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"themes": "Teemat",
"to-reduce": "Vähennettävää",
"total": "yhteensä",
"value": "arvo",
"type": "Tyyppi",
"under-relative-time": "Alle {relativeTime}",
"updated": "Päivitetty",
Expand Down
1 change: 1 addition & 0 deletions locales/lv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"themes": "Tēmas",
"to-reduce": "Kreisajā pusē, lai samazinātu",
"total": "kopā",
"value": "vērtība",
"type": "Tips",
"with-contact-persons": "Vai ir kontaktpersona",
"indicator-compare-source": "Rāda",
Expand Down
1 change: 1 addition & 0 deletions locales/pt-BR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"themes": "Temas",
"to-reduce": "Esquerda para reduzir",
"total": "total",
"value": "valor",
"type": "Tipo",
"under-relative-time": "Em {relativeTime}",
"updated": "Atualizado",
Expand Down
1 change: 1 addition & 0 deletions locales/sv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"themes": "Teman",
"to-reduce": "Kvar för att minska",
"total": "totalt",
"value": "värde",
"type": "Typ",
"under-relative-time": "Lägre som {relativeTime}",
"updated": "Uppdaterad",
Expand Down

0 comments on commit 054427f

Please sign in to comment.