Commit 7ac6c505 authored by benjaminParisel's avatar benjaminParisel Committed by abirembaut

fix(translate): translate artifact name in success import popup (#2431)

Close [BS-18179](https://bonitasoft.atlassian.net/browse/BS-18179)
parent 30e71336
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
vm.joinOnNames = joinOnNames; vm.joinOnNames = joinOnNames;
vm.getState = getState; vm.getState = getState;
vm.translateKeys = translateKeys;
function joinOnNames(artifacts) { function joinOnNames(artifacts) {
return artifacts.map(function(item) { return artifacts.map(function(item) {
...@@ -37,6 +38,16 @@ ...@@ -37,6 +38,16 @@
} }
return gettextCatalog.getString('added'); return gettextCatalog.getString('added');
} }
function translateKeys(key) {
return {
'page': gettextCatalog.getString('page'),
'form': gettextCatalog.getString('form'),
'widget': gettextCatalog.getString('widget'),
'layout': gettextCatalog.getString('layout'),
'fragment': gettextCatalog.getString('fragment')
}[key] || key;
}
} }
})(); })();
<div class="ImportReport" ng-controller="ImportSuccessMessageController as import"> <div class="ImportReport" ng-controller="ImportSuccessMessageController as import">
<p><span class="ImportReport-type">{{ type | translate }}</span> <strong>{{ element.name }}</strong> <p><span class="ImportReport-type">{{import.translateKeys(type)}}</span> <strong>{{ element.name }}</strong>
<translate>successfully imported.</translate> <translate>successfully imported.</translate>
</p> </p>
<section class="ImportReport-added" ng-if="dependencies.added"> <section class="ImportReport-added" ng-if="dependencies.added">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment