Handle i18n of profile parameters

This commit is contained in:
Phyks (Lucas Verney) 2019-09-02 13:37:08 +02:00
parent aa6d13025c
commit 39b7dd4a0a

View file

@ -159,10 +159,19 @@ BR.Profile = L.Evented.extend({
return;
}
label.appendChild(input);
label.append(' ' + param);
var name = i18next.exists('profileParameters.' + param + '.name')
? i18next.t('profileParameters.' + param + '.name')
: param;
label.append(' ' + name);
div.appendChild(label);
var small = document.createElement('small');
small.innerHTML = ' (' + params[param].description.replace(/^\s+|\s+$/g, '') + ')';
var description = i18next.exists('profileParameters.' + param + '.description')
? i18next.t('profileParameters.' + param + '.description')
: params[param].description.replace(/^\s+|\s+$/g, '');
small.innerHTML = ' (' + description + ')';
div.appendChild(small);
paramsSection.appendChild(div);
});