mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
chat: Translate newly created message entries
This commit is contained in:
parent
99b7bdd176
commit
6bf8142221
1 changed files with 8 additions and 5 deletions
|
@ -189,6 +189,7 @@ exports.chat = (() => {
|
||||||
.append($('<div>').html(ctx.text).contents());
|
.append($('<div>').html(ctx.text).contents());
|
||||||
if (isHistoryAdd) chatMsg.insertAfter('#chatloadmessagesbutton');
|
if (isHistoryAdd) chatMsg.insertAfter('#chatloadmessagesbutton');
|
||||||
else $('#chattext').append(chatMsg);
|
else $('#chattext').append(chatMsg);
|
||||||
|
chatMsg.each((i, e) => html10n.translateElement(html10n.translations, e));
|
||||||
|
|
||||||
// should we increment the counter??
|
// should we increment the counter??
|
||||||
if (increment && !isHistoryAdd) {
|
if (increment && !isHistoryAdd) {
|
||||||
|
@ -198,12 +199,14 @@ exports.chat = (() => {
|
||||||
$('#chatcounter').text(count);
|
$('#chatcounter').text(count);
|
||||||
|
|
||||||
if (!chatOpen && ctx.duration > 0) {
|
if (!chatOpen && ctx.duration > 0) {
|
||||||
$.gritter.add({
|
const text = $('<p>')
|
||||||
text: $('<p>')
|
|
||||||
.append($('<span>').addClass('author-name').text(ctx.authorName))
|
.append($('<span>').addClass('author-name').text(ctx.authorName))
|
||||||
// ctx.text was HTML-escaped before calling the hook. Hook functions are trusted
|
// ctx.text was HTML-escaped before calling the hook. Hook functions are trusted
|
||||||
// to not introduce an XSS vulnerability by adding unescaped user input.
|
// to not introduce an XSS vulnerability by adding unescaped user input.
|
||||||
.append($('<div>').html(ctx.text).contents()),
|
.append($('<div>').html(ctx.text).contents());
|
||||||
|
text.each((i, e) => html10n.translateElement(html10n.translations, e));
|
||||||
|
$.gritter.add({
|
||||||
|
text,
|
||||||
sticky: ctx.sticky,
|
sticky: ctx.sticky,
|
||||||
time: ctx.duration,
|
time: ctx.duration,
|
||||||
position: 'bottom',
|
position: 'bottom',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue