cleanup: Prefer template strings

Template strings are much nicer than string concatenation, so use
them where possible; this excludes translatable strings and any
strings containing '/' (until we can depend on gettext >= 0.20[0]).

[0] https://savannah.gnu.org/bugs/?50920

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/612
This commit is contained in:
Florian Müllner
2019-01-30 01:18:24 +01:00
committed by Florian Müllner
parent 46874eed05
commit 0d035a4e53
51 changed files with 188 additions and 188 deletions

View File

@ -216,7 +216,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
validate: this._validateWpaPsk, password: true });
break;
case 'none': // static WEP
secrets.push({ label: _("Key: "), key: 'wep-key' + wirelessSecuritySetting.wep_tx_keyidx,
secrets.push({ label: _("Key: "), key: `wep-key${wirelessSecuritySetting.wep_tx_keyidx}`,
value: wirelessSecuritySetting.get_wep_key(wirelessSecuritySetting.wep_tx_keyidx) || '',
wep_key_type: wirelessSecuritySetting.wep_key_type,
validate: this._validateStaticWep, password: true });
@ -232,7 +232,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
this._get8021xSecrets(secrets);
break;
default:
log('Invalid wireless key management: ' + wirelessSecuritySetting.key_mgmt);
log(`Invalid wireless key management: ${wirelessSecuritySetting.key_mgmt}`);
}
}
@ -274,7 +274,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
value: ieee8021xSetting.private_key_password || '', password: true });
break;
default:
log('Invalid EAP/IEEE802.1x method: ' + ieee8021xSetting.get_eap_method(0));
log(`Invalid EAP/IEEE802.1x method: ${ieee8021xSetting.get_eap_method(0)}`);
}
}
@ -344,7 +344,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
this._getMobileSecrets(content.secrets, connectionType);
break;
default:
log('Invalid connection type: ' + connectionType);
log(`Invalid connection type: ${connectionType}`);
}
return content;
@ -588,12 +588,12 @@ var VPNRequestHandler = class {
try {
vpnSetting.foreach_data_item((key, value) => {
this._stdin.write('DATA_KEY=' + key + '\n', null);
this._stdin.write('DATA_VAL=' + (value || '') + '\n\n', null);
this._stdin.write(`DATA_KEY=${key}\n`, null);
this._stdin.write(`DATA_VAL=${value || ''}\n\n`, null);
});
vpnSetting.foreach_secret((key, value) => {
this._stdin.write('SECRET_KEY=' + key + '\n', null);
this._stdin.write('SECRET_VAL=' + (value || '') + '\n\n', null);
this._stdin.write(`SECRET_KEY=${key}\n`, null);
this._stdin.write(`SECRET_VAL=${value || ''}\n\n`, null);
});
this._stdin.write('DONE\n\n', null);
} catch (e) {
@ -622,7 +622,7 @@ var NetworkAgent = class {
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
monitor.connect('changed', () => this._vpnCacheBuilt = false);
} catch (e) {
log('Failed to create monitor for VPN plugin dir: ' + e.message);
log(`Failed to create monitor for VPN plugin dir: ${e.message}`);
}
this._native.connect('new-request', this._newRequest.bind(this));
@ -709,7 +709,7 @@ var NetworkAgent = class {
body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id());
break;
default:
log('Invalid connection type: ' + connectionType);
log(`Invalid connection type: ${connectionType}`);
this._native.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
return;
}