js: Use templates for non-translatable strings

This reverts commit 9d941f8202 and replaces all additional
instances of .format() that have been added since.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2160>
This commit is contained in:
Florian Müllner
2022-02-07 15:14:06 +01:00
committed by Marge Bot
parent 29dfde5a4a
commit a1dd1b25d8
51 changed files with 254 additions and 261 deletions

View File

@ -114,7 +114,7 @@ var TelepathyComponent = class {
try {
this._client.register();
} catch (e) {
throw new Error('Could not register Telepathy client. Error: %s'.format(e.toString()));
throw new Error(`Could not register Telepathy client. Error: ${e}`);
}
if (!this._client.account_manager.is_prepared(Tp.AccountManager.get_feature_quark_core()))
@ -282,7 +282,7 @@ class TelepathyClient extends Tp.BaseClient {
await dispatchOp.claim_with_async(this);
this._handlingChannels(account, conn, [channel], false);
} catch (err) {
log('Failed to Claim channel: %s'.format(err.toString()));
log(`Failed to claim channel: ${err}`);
}
}
@ -702,7 +702,7 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
if (message.messageType == Tp.ChannelTextMessageType.ACTION) {
let senderAlias = GLib.markup_escape_text(message.sender, -1);
messageBody = '<i>%s</i> %s'.format(senderAlias, messageBody);
messageBody = `<i>${senderAlias}</i> ${messageBody}`;
styles.push('chat-action');
}