Skip to content

Commit b310d62

Browse files
committed
Updated to use translation strings
Signed-off-by: Sekwah <[email protected]>
1 parent 5afc976 commit b310d62

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/views/components/PolicyViolationProgressBar.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
</b-progress>
1414
</span>
1515
<b-tooltip :target="'progressbar' + hoverId" placement="left" noninteractive>
16-
Info: {{ info }}<br>
17-
Warn: {{ warn }}<br>
18-
Fail: {{ fail }}<br>
19-
Total: {{ total }}<br>
16+
<div style="text-align: left;">
17+
{{$t('policy_violation.infos')}}: {{ info }}<br>
18+
{{$t('policy_violation.warns')}}: {{ warn }}<br>
19+
{{$t('policy_violation.fails')}}: {{ fail }}<br>
20+
{{$t('message.total')}}: {{ total }}<br>
21+
</div>
2022
</b-tooltip>
2123
</span>
2224
</template>
@@ -28,6 +30,7 @@ export default {
2830
info: Number,
2931
warn: Number,
3032
fail: Number,
33+
$t: Function,
3134
},
3235
data() {
3336
return {

src/views/portfolio/projects/ProjectList.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,23 @@
121121
{
122122
title: this.$t('message.policy_violations'),
123123
field: "metrics",
124-
formatter(metrics, row, index) {
124+
formatter: function (metrics) {
125125
if (typeof metrics === "undefined") {
126126
return "-"; // No vulnerability info available
127127
}
128-
129128
let ComponentClass = Vue.extend(PolicyViolationProgressBar);
130129
let progressBar = new ComponentClass({
131130
propsData: {
132131
total: metrics.policyViolationsTotal,
133132
warn: metrics.policyViolationsWarn,
134133
fail: metrics.policyViolationsFail,
135134
info: metrics.policyViolationsInfo,
135+
$t: this.$t.bind(this),
136136
}
137137
});
138138
progressBar.$mount();
139139
return progressBar.$el.outerHTML;
140-
}
140+
}.bind(this)
141141
},
142142
{
143143
title: this.$t('message.vulnerabilities'),

0 commit comments

Comments
 (0)