From e1c3b0c002c440f215ea48fe55cd41f411f51948 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 4 Aug 2018 09:51:01 +0200 Subject: [PATCH] Added an attribute to createElem2 to ease translation. --- assets/js/common/utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/js/common/utils.js b/assets/js/common/utils.js index 7799faaa..2691c77e 100644 --- a/assets/js/common/utils.js +++ b/assets/js/common/utils.js @@ -39,6 +39,7 @@ function createElem(nodeType, appendTo){ * @info {String} value The value of the new element * @info {String} placeholder The placeholder of the new element * @info {String} innerHTML Specify the html content of the newly created element + * @info {String} innerLang Specify the key of the lang to use to fill the element * @info {boolean} disabled Set whether the field should be disabled or not (input only) * @return {HTMLElement} The newly created element */ @@ -101,6 +102,9 @@ function createElem2(infos){ //Specify node content if(infos.innerHTML) newElem.innerHTML = infos.innerHTML; + + if(infos.innerLang) + newElem.innerHTML = lang(infos.innerLang); //Set field state if(infos.disabled)