html not interpreted for translated messages
Concerned version
Version: %2.0.2
Platform: Any
Summary
When translating messages, for example in lemonldap-ng.ini:
msg_en_authRemaining = %s authentications left, please change your password clicking <a href="https://auth.domain.com/?tab=password">here</a>
the HTML is not interpreted.
Fix
I suggest replacing every 3 .text() methods in translatePage function by .html() in portal.js
Before:
translatePage = function(lang) {
[...]
return $(this).text(txt);
});
$("[trmsg]").each(function() {
return $(this).text(translate("PE" + ($(this).attr('trmsg'))));
});
$("[trplaceholder]").each(function() {
return $(this).attr('placeholder', translate($(this).attr('trplaceholder')));
});
return $("[localtime]").each(function() {
var d;
d = new Date($(this).attr('localtime') * 1000);
return $(this).text(d.toLocaleString());
[...]
};
After:
translatePage = function(lang) {
[...]
return $(this).html(txt);
});
$("[trmsg]").each(function() {
return $(this).html(translate("PE" + ($(this).attr('trmsg'))));
});
$("[trplaceholder]").each(function() {
return $(this).attr('placeholder', translate($(this).attr('trplaceholder')));
});
return $("[localtime]").each(function() {
var d;
d = new Date($(this).attr('localtime') * 1000);
return $(this).html(d.toLocaleString());
[...]
};
I have tested my previous use case with success.