summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/js/libs/application.js15
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties4
2 files changed, 18 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/libs/application.js b/server/sonar-web/src/main/js/libs/application.js
index bdbc78a7524..82f612db355 100644
--- a/server/sonar-web/src/main/js/libs/application.js
+++ b/server/sonar-web/src/main/js/libs/application.js
@@ -500,6 +500,18 @@ function closeModalWindow () {
return String.fromCharCode(97 + value - 1).toUpperCase();
};
+
+ /**
+ * Format a level measure
+ * @param {number} value
+ */
+ var levelFormatter = function (value) {
+ var l10nKey = 'metric.level.' + value,
+ result = window.t(l10nKey);
+ // if couldn't translate, return the initial value
+ return l10nKey !== result ? result : value;
+ };
+
/**
* Format a measure according to its type
* @param measure
@@ -524,7 +536,8 @@ function closeModalWindow () {
},
'WORK_DUR': durationFormatter,
'SHORT_WORK_DUR': shortDurationFormatter,
- 'RATING': ratingFormatter
+ 'RATING': ratingFormatter,
+ 'LEVEL': levelFormatter
};
if (measure != null && type != null) {
formatted = formatters[type] != null ? formatters[type](measure) : measure;
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index 29ff7210aae..4a5d04c377c 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -2787,6 +2787,10 @@ metric.type.DISTRIB=Distribution
metric.type.RATING=Rating
metric.type.WORK_DUR=Work Duration
+metric.level.ERROR=Error
+metric.level.WARN=Warning
+metric.level.OK=Ok
+
#------------------------------------------------------------------------------
#