Skip to content

Commit

Permalink
Handle i18n of profile parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Phyks committed Sep 27, 2019
1 parent aa6d130 commit 39b7dd4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions js/control/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 39b7dd4

Please sign in to comment.