diff --git a/commons/src/main/java/org/open4goods/model/data/Score.java b/commons/src/main/java/org/open4goods/model/data/Score.java index 5b25bab9e..ee961edf3 100644 --- a/commons/src/main/java/org/open4goods/model/data/Score.java +++ b/commons/src/main/java/org/open4goods/model/data/Score.java @@ -10,6 +10,7 @@ import org.open4goods.model.Validable; import org.open4goods.model.attribute.Cardinality; import org.open4goods.model.constants.Currency; +import org.open4goods.model.product.AggregatedPrice; import org.open4goods.services.StandardiserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -107,6 +108,13 @@ public Long percent() { return Math.round(relativ.getValue() * 100 / StandardiserService.DEFAULT_MAX_RATING); } + public String absValue () { + return AggregatedPrice.numberFormater.format(absolute.getValue()); + } + + public String relValue () { + return AggregatedPrice.numberFormater.format(relativ.getValue()); + } /////////////////////// // The following helper allow to know the ranking, on a 5 scale diff --git a/commons/src/main/java/org/open4goods/model/product/AggregatedPrice.java b/commons/src/main/java/org/open4goods/model/product/AggregatedPrice.java index b1ba2639a..12ee3fb26 100644 --- a/commons/src/main/java/org/open4goods/model/product/AggregatedPrice.java +++ b/commons/src/main/java/org/open4goods/model/product/AggregatedPrice.java @@ -13,7 +13,8 @@ public class AggregatedPrice extends Price { - private static final DecimalFormat df = new DecimalFormat("0.00"); + //TODO : shared, ugly + public static final DecimalFormat numberFormater = new DecimalFormat("0.00"); @Field(index = false, store = false, type = FieldType.Keyword) private String datasourceName; @@ -90,7 +91,7 @@ public String shortPrice() { if (isInt) { return String.valueOf(p.intValue()); } else { - return String.valueOf(df.format(p)); + return String.valueOf(numberFormater.format(p)); } } diff --git a/ui/src/main/resources/i18n/messages_fr.properties b/ui/src/main/resources/i18n/messages_fr.properties index 8212489bf..f232092a8 100644 --- a/ui/src/main/resources/i18n/messages_fr.properties +++ b/ui/src/main/resources/i18n/messages_fr.properties @@ -1,3 +1,9 @@ +ecoscore.WARRANTY.tooltip = La garantie est de {0} an(s). +ecoscore.DATA-QUALITY.tooltip = La qualité de la donnée est de {1} sur 5. +ecoscore.REPAIRABILITY_INDEX.tooltip = L''indice de réparabilité est de {0} sur 10 ({1}/5 en valeur relative). +ecoscore.CLASSE_ENERGY.tooltip = La classe énergétique est {2}. ({1}/5 en valeur relative) +ecoscore.BRAND_SUSTAINABILITY.tooltip = L''évaluation de la marque indique {0} sur 10 ({1}/5 en valeur relative). Cliquez sur ''Explications'' pour en savoir plus. + score-BRAND_SUSTAINABILITY = Evaluation de la marque score-DATA-QUALITY = Qualité de la donnée score-WARRANTY = Garantie diff --git a/ui/src/main/resources/templates/ecoscore.html b/ui/src/main/resources/templates/ecoscore.html index 5c1bc794f..c36c4462d 100644 --- a/ui/src/main/resources/templates/ecoscore.html +++ b/ui/src/main/resources/templates/ecoscore.html @@ -48,8 +48,8 @@