mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 20:49:04 +01:00
Api: Attributes can contain multiple translatable substrings wrapped with {}
This commit is contained in:
parent
081b692dd1
commit
684d0846dc
@ -1108,9 +1108,20 @@ export function loadWebComponent(_nodeName : string, _template_node, parent : Et
|
|||||||
default:
|
default:
|
||||||
attrValue = mgr.expandName(attrValue);
|
attrValue = mgr.expandName(attrValue);
|
||||||
if(!_template_node.getAttribute("no_lang") && widget_class.translate[attribute])
|
if(!_template_node.getAttribute("no_lang") && widget_class.translate[attribute])
|
||||||
|
{
|
||||||
|
// 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);
|
attrValue = widget.egw().lang(attrValue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user