Commit 561bdbba authored by linkmauve's avatar linkmauve Committed by JC Brand

Always use formatting inside translatable strings (#983)

This helps translators reorder words in the string.
parent 9231781a
...@@ -581,8 +581,8 @@ ...@@ -581,8 +581,8 @@
} else if (status === Strophe.Status.CONNFAIL) { } else if (status === Strophe.Status.CONNFAIL) {
let feedback = message; let feedback = message;
if (message === "host-unknown" || message == "remote-connection-failed") { if (message === "host-unknown" || message == "remote-connection-failed") {
feedback = __("Sorry, we could not connect to the XMPP host with domain: ") + feedback = __("Sorry, we could not connect to the XMPP host with domain: %1$s",
`\"${Strophe.getDomainFromJid(_converse.connection.jid)}\"`; `\"${Strophe.getDomainFromJid(_converse.connection.jid)}\"`);
} else if (!_.isUndefined(message) && message === _.get(Strophe, 'ErrorCondition.NO_AUTH_MECH')) { } else if (!_.isUndefined(message) && message === _.get(Strophe, 'ErrorCondition.NO_AUTH_MECH')) {
feedback = __("The XMPP server did not offer a supported authentication mechanism"); feedback = __("The XMPP server did not offer a supported authentication mechanism");
} }
......
...@@ -1845,12 +1845,14 @@ ...@@ -1845,12 +1845,14 @@
tpl_info({ tpl_info({
'data': `data-leavejoin="${nick}"`, 'data': `data-leavejoin="${nick}"`,
'isodate': moment().format(), 'isodate': moment().format(),
'message': __(nick+' has left and re-entered the room.') 'message': __('%1$s has left and re-entered the room.', nick)
}); });
} else { } else {
let message = __(nick+' has entered the room.'); let message;
if (_.get(stat, 'textContent')) { if (_.get(stat, 'textContent')) {
message = message + ' "' + stat.textContent + '"'; message = __('%1$s has entered the room. "%2$s"', nick, stat.textContent);
} else {
message = __('%1$s has entered the room.', nick);
} }
const data = { const data = {
'data': `data-join="${nick}"`, 'data': `data-join="${nick}"`,
...@@ -1877,9 +1879,11 @@ ...@@ -1877,9 +1879,11 @@
if (_.includes(_.get(last_el, 'classList', []), 'chat-info') && if (_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
_.get(last_el, 'dataset', {}).join === `"${nick}"`) { _.get(last_el, 'dataset', {}).join === `"${nick}"`) {
let message = __('%1$s has entered and left the room.', nick); let message;
if (_.get(stat, 'textContent')) { if (_.get(stat, 'textContent')) {
message = message + ' "' + stat.textContent + '"'; message = __('%1$s has entered and left the room. "%2$s"', nick, stat.textContent);
} else {
message = __('%1$s has entered and left the room.', nick);
} }
last_el.outerHTML = last_el.outerHTML =
tpl_info({ tpl_info({
...@@ -1888,9 +1892,11 @@ ...@@ -1888,9 +1892,11 @@
'message': message 'message': message
}); });
} else { } else {
let message = __('%1$s has left the room.', nick); let message;
if (_.get(stat, 'textContent')) { if (_.get(stat, 'textContent')) {
message = message + ' "' + stat.textContent + '"'; message = __('%1$s has left the room. "%2$s"', nick, stat.textContent);
} else {
message = __('%1$s has left the room.', nick);
} }
const data = { const data = {
'message': message, 'message': message,
...@@ -2462,8 +2468,9 @@ ...@@ -2462,8 +2468,9 @@
promptForInvite (suggestion) { promptForInvite (suggestion) {
const reason = prompt( const reason = prompt(
__('You are about to invite %1$s to the chat room "%2$s". ', suggestion.text.label, this.model.get('id')) + __('You are about to invite %1$s to the chat room "%2$s". '+
__("You may optionally include a message, explaining the reason for the invitation.") 'You may optionally include a message, explaining the reason for the invitation.',
suggestion.text.label, this.model.get('id'))
); );
if (reason !== null) { if (reason !== null) {
this.chatroomview.directInvite(suggestion.text.value, reason); this.chatroomview.directInvite(suggestion.text.value, reason);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment