From aad4db161703795590f1fccc3d019c5472b0033e Mon Sep 17 00:00:00 2001
From: Ralf Becker <RalfBecker@outdoor-training.de>
Date: Fri, 19 Apr 2019 10:17:09 +0200
Subject: [PATCH] allow statustext to contain multiple translated sub-strings
 eg: {Firstname}.{Lastname} as we do for options already. This allows to
 preserve existing translations, while adding further stuff

---
 api/js/etemplate/et2_core_baseWidget.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/api/js/etemplate/et2_core_baseWidget.js b/api/js/etemplate/et2_core_baseWidget.js
index 6acb3c9284..017a3e13ba 100644
--- a/api/js/etemplate/et2_core_baseWidget.js
+++ b/api/js/etemplate/et2_core_baseWidget.js
@@ -267,6 +267,16 @@ var et2_baseWidget = (function(){ "use strict"; return et2_DOMWidget.extend(et2_
 			return;
 		}
 
+		// allow statustext to contain multiple translated sub-strings eg: {Firstname}.{Lastname}
+		if (_value.indexOf('{') !== -1)
+		{
+			var egw = this.egw();
+			_value = _value.replace(/{([^}]+)}/g, function(str,p1)
+			{
+				return egw.lang(p1);
+			});
+		}
+
 		this.statustext = _value;
 
 		//Get the domnode the tooltip should be attached to