diff --git a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html index 35dcc94f2..98daab485 100644 --- a/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html +++ b/li.strolch.mvn.archetype.webapp/src/main/resources/archetype-resources/src/main/webapp/app/src/behaviors/c-compute-behavior.html @@ -470,6 +470,22 @@ showToast: function (text) { this.fire('cx-show-toast', {text: text}); + }, + + localizeJsonMsg: function (jsonMsg) { + if (jsonMsg == null) + return jsonMsg; + if (jsonMsg.values == null || jsonMsg.values.length == 0) + return this.localize(jsonMsg.key); + + var values = [jsonMsg.key]; + var keys = Object.keys(jsonMsg.values); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + values.push(key); + values.push(jsonMsg.values[key]); + } + return this.localize.apply(null, values); } }; \ No newline at end of file