Skip to content

Commit 81b7864

Browse files
committed
Handle translation if info label
1 parent 668cf2f commit 81b7864

File tree

1 file changed

+18
-1
lines changed
  • lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/plugin

1 file changed

+18
-1
lines changed

lib/CallBackery/qooxdoo/callbackery/source/class/callbackery/ui/plugin/CardList.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,29 @@ qx.Class.define("callbackery.ui.plugin.CardList", {
8484
rpc.callAsync(function(data,exc){
8585
if (!exc){
8686
if (Array.isArray(data)){
87+
// the data is an array of card data
8788
that.setData(data,true);
8889
that.setInfo(null);
8990
}
9091
else {
92+
// the data is an object with card data and info
9193
that.setData(data.data,true);
92-
that.setInfo(data.info);
94+
if (data.info) {
95+
// label is the translation key
96+
// args is an array of arguments for the translation
97+
let args = data.info.args;
98+
delete data.info.args;
99+
if (args && args.length > 0) {
100+
data.info.label = that.xtr(data.info.label, ...args);
101+
}
102+
else {
103+
data.info.label = that.tr(data.info.label);
104+
}
105+
that.setInfo(data.info);
106+
}
107+
else {
108+
that.setInfo(null);
109+
}
93110
}
94111
if (that._hasTrigger) {
95112
that._reconfForm();

0 commit comments

Comments
 (0)