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 @@
} else if (status === Strophe.Status.CONNFAIL) {
let feedback = message;
if (message === "host-unknown" || message == "remote-connection-failed") {
feedback = __("Sorry, we could not connect to the XMPP host with domain: ") +
`\"${Strophe.getDomainFromJid(_converse.connection.jid)}\"`;
feedback = __("Sorry, we could not connect to the XMPP host with domain: %1$s",
`\"${Strophe.getDomainFromJid(_converse.connection.jid)}\"`);
} else if (!_.isUndefined(message) && message === _.get(Strophe, 'ErrorCondition.NO_AUTH_MECH')) {
feedback = __("The XMPP server did not offer a supported authentication mechanism");
}
......
......@@ -1845,12 +1845,14 @@
tpl_info({
'data': `data-leavejoin="${nick}"`,
'isodate': moment().format(),
'message': __(nick+' has left and re-entered the room.')
'message': __('%1$s has left and re-entered the room.', nick)
});
} else {
let message = __(nick+' has entered the room.');
let message;
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 = {
'data': `data-join="${nick}"`,
......@@ -1877,9 +1879,11 @@
if (_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
_.get(last_el, 'dataset', {}).join === `"${nick}"`) {
let message = __('%1$s has entered and left the room.', nick);
let message;
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 =
tpl_info({
......@@ -1888,9 +1892,11 @@
'message': message
});
} else {
let message = __('%1$s has left the room.', nick);
let message;
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 = {
'message': message,
......@@ -2462,8 +2468,9 @@
promptForInvite (suggestion) {
const reason = prompt(
__('You are about to invite %1$s to the chat room "%2$s". ', suggestion.text.label, this.model.get('id')) +
__("You may optionally include a message, explaining the reason for the invitation.")
__('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.',
suggestion.text.label, this.model.get('id'))
);
if (reason !== null) {
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