mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Api: Attributes can contain multiple translatable substrings wrapped with {}
This commit is contained in:
parent
081b692dd1
commit
684d0846dc
@ -1109,7 +1109,18 @@ export function loadWebComponent(_nodeName : string, _template_node, parent : Et
|
||||
attrValue = mgr.expandName(attrValue);
|
||||
if(!_template_node.getAttribute("no_lang") && widget_class.translate[attribute])
|
||||
{
|
||||
attrValue = widget.egw().lang(attrValue);
|
||||
// allow attribute to contain multiple translated sub-strings eg: {Firstname}.{Lastname}
|
||||
if(attrValue.indexOf('{') !== -1)
|
||||
{
|
||||
attrValue = attrValue.replace(/{([^}]+)}/g, function(str, p1)
|
||||
{
|
||||
return this.egw().lang(p1);
|
||||
}.bind(widget));
|
||||
}
|
||||
else
|
||||
{
|
||||
attrValue = widget.egw().lang(attrValue);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user