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

@ -78,7 +78,7 @@ class URLHighlighter extends St.Label {
if (urlId != -1) {
let url = this._urls[urlId].url;
if (!url.includes(':'))
url = 'http://%s'.format(url);
url = `http://${url}`;
Gio.app_info_launch_default_for_uri(
url, global.create_app_launch_context(0, -1));
@ -131,7 +131,7 @@ class URLHighlighter extends St.Label {
for (let i = 0; i < urls.length; i++) {
let url = urls[i];
let str = this._text.substr(pos, url.pos - pos);
markup += '%s<span foreground="%s"><u>%s</u></span>'.format(str, this._linkColor, url.url);
markup += `${str}<span foreground="${this._linkColor}"><u>${url.url}</u></span>`;
pos = url.pos + url.url.length;
}
markup += this._text.substr(pos);