From 6a22af83dc654f888a7863d5809974e9982fdeae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 7 Aug 2023 00:34:20 +0200 Subject: [PATCH] cleanup: Always use single quotes We have made good progress with transitioning to the new style, to the point where we can complete it with a final push. Start with changing the remaining places that still use double quotes. Part-of: --- js/gdm/loginDialog.js | 8 +++---- js/gdm/realmd.js | 6 ++--- js/gdm/util.js | 2 +- js/misc/introspect.js | 2 +- js/misc/loginManager.js | 4 ++-- js/misc/modemManager.js | 6 ++--- js/misc/systemActions.js | 10 ++++---- js/misc/util.js | 2 +- js/ui/appDisplay.js | 2 +- js/ui/audioDeviceSelection.js | 6 ++--- js/ui/backgroundMenu.js | 4 ++-- js/ui/barLevel.js | 2 +- js/ui/calendar.js | 18 +++++++------- js/ui/closeDialog.js | 6 ++--- js/ui/components/automountManager.js | 8 +++---- js/ui/components/autorunManager.js | 4 ++-- js/ui/components/networkAgent.js | 36 ++++++++++++++-------------- js/ui/components/polkitAgent.js | 6 ++--- js/ui/dash.js | 4 ++-- js/ui/dnd.js | 2 +- js/ui/endSessionDialog.js | 26 ++++++++++---------- js/ui/extensionSystem.js | 2 +- js/ui/kbdA11yDialog.js | 16 ++++++------- js/ui/lookingGlass.js | 6 ++--- js/ui/main.js | 2 +- js/ui/messageList.js | 4 ++-- js/ui/messageTray.js | 2 +- js/ui/mpris.js | 4 ++-- js/ui/overview.js | 2 +- js/ui/padOsd.js | 10 ++++---- js/ui/panel.js | 4 ++-- js/ui/popupMenu.js | 2 +- js/ui/screenshot.js | 4 ++-- js/ui/scripting.js | 4 ++-- js/ui/search.js | 6 ++--- js/ui/sessionMode.js | 2 +- js/ui/shellEntry.js | 8 +++---- js/ui/status/accessibility.js | 18 +++++++------- js/ui/status/dwellClick.js | 10 ++++---- js/ui/status/keyboard.js | 8 +++---- js/ui/status/location.js | 2 +- js/ui/status/network.js | 2 +- js/ui/status/thunderbolt.js | 14 +++++------ js/ui/windowAttentionHandler.js | 2 +- js/ui/windowManager.js | 4 ++-- js/ui/windowMenu.js | 26 ++++++++++---------- lint/eslintrc-legacy.yml | 1 - 47 files changed, 164 insertions(+), 165 deletions(-) diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 2d354ff43..a1a800ccb 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -321,7 +321,7 @@ const SessionMenuButton = GObject.registerClass({ reactive: true, track_hover: true, can_focus: true, - accessible_name: _("Choose Session"), + accessible_name: _('Choose Session'), accessible_role: Atk.Role.MENU, x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER, @@ -466,7 +466,7 @@ export const LoginDialog = GObject.registerClass({ // login screen. It can be activated to reveal an entry for // manually entering the username. let notListedLabel = new St.Label({ - text: _("Not listed?"), + text: _('Not listed?'), style_class: 'login-dialog-not-listed-label', }); this._notListedButton = new St.Button({ @@ -934,7 +934,7 @@ export const LoginDialog = GObject.registerClass({ // Translators: this message is shown below the username entry field // to clue the user in on how to login to the local network realm - this._authPrompt.setMessage(_("(e.g., user or %s)").format(hint), GdmUtil.MessageType.HINT); + this._authPrompt.setMessage(_('(e.g., user or %s)').format(hint), GdmUtil.MessageType.HINT); } _askForUsernameAndBeginVerification() { @@ -1262,7 +1262,7 @@ export const LoginDialog = GObject.registerClass({ open() { Main.ctrlAltTabManager.addGroup(this, - _("Login Window"), + _('Login Window'), 'dialog-password-symbolic', { sortGroup: CtrlAltTab.SortGroup.MIDDLE }); this.activate(); diff --git a/js/gdm/realmd.js b/js/gdm/realmd.js index 7b386d916..09c19e125 100644 --- a/js/gdm/realmd.js +++ b/js/gdm/realmd.js @@ -5,13 +5,13 @@ import * as Signals from '../misc/signals.js'; import {loadInterfaceXML} from '../misc/fileUtils.js'; -const ProviderIface = loadInterfaceXML("org.freedesktop.realmd.Provider"); +const ProviderIface = loadInterfaceXML('org.freedesktop.realmd.Provider'); const Provider = Gio.DBusProxy.makeProxyWrapper(ProviderIface); -const ServiceIface = loadInterfaceXML("org.freedesktop.realmd.Service"); +const ServiceIface = loadInterfaceXML('org.freedesktop.realmd.Service'); const Service = Gio.DBusProxy.makeProxyWrapper(ServiceIface); -const RealmIface = loadInterfaceXML("org.freedesktop.realmd.Realm"); +const RealmIface = loadInterfaceXML('org.freedesktop.realmd.Realm'); const Realm = Gio.DBusProxy.makeProxyWrapper(RealmIface); export class Manager extends Signals.EventEmitter { diff --git a/js/gdm/util.js b/js/gdm/util.js index 837f12eec..9d236958a 100644 --- a/js/gdm/util.js +++ b/js/gdm/util.js @@ -521,7 +521,7 @@ export class ShellUserVerifier extends Signals.EventEmitter { this._defaultService = FINGERPRINT_SERVICE_NAME; if (!this._defaultService) { - log("no authentication service is enabled, using password authentication"); + log('no authentication service is enabled, using password authentication'); this._defaultService = PASSWORD_SERVICE_NAME; } } diff --git a/js/misc/introspect.js b/js/misc/introspect.js index aa50dc78c..163919aa6 100644 --- a/js/misc/introspect.js +++ b/js/misc/introspect.js @@ -75,7 +75,7 @@ export class IntrospectService { _syncRunningApplications() { let tracker = Shell.WindowTracker.get_default(); let apps = this._appSystem.get_running(); - let seatName = "seat0"; + let seatName = 'seat0'; let newRunningApplications = {}; let newActiveApplication = null; diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index 02b561bee..3dc6e3f7f 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -15,7 +15,7 @@ const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIf const SystemdLoginUser = Gio.DBusProxy.makeProxyWrapper(SystemdLoginUserIface); function haveSystemd() { - return GLib.access("/run/systemd/seats", 0) >= 0; + return GLib.access('/run/systemd/seats', 0) >= 0; } function versionCompare(required, reference) { @@ -53,7 +53,7 @@ export function canLock() { } export async function registerSessionWithGDM() { - log("Registering session with GDM"); + log('Registering session with GDM'); try { await Gio.DBus.system.call( 'org.gnome.DisplayManager', diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js index 407106f8f..61b27539b 100644 --- a/js/misc/modemManager.js +++ b/js/misc/modemManager.js @@ -276,13 +276,13 @@ export const BroadbandModem = GObject.registerClass({ } _reloadOperatorName() { - let newName = ""; + let newName = ''; if (this.operator_name_3gpp && this.operator_name_3gpp.length > 0) newName += this.operator_name_3gpp; if (this.operator_name_cdma && this.operator_name_cdma.length > 0) { - if (newName != "") - newName += ", "; + if (newName != '') + newName += ', '; newName += this.operator_name_cdma; } diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js index 098688756..ae02a74f7 100644 --- a/js/misc/systemActions.js +++ b/js/misc/systemActions.js @@ -88,7 +88,7 @@ const SystemActions = GObject.registerClass({ this._actions = new Map(); this._actions.set(POWER_OFF_ACTION_ID, { // Translators: The name of the power-off action in search - name: C_("search-result", "Power Off"), + name: C_('search-result', 'Power Off'), iconName: 'system-shutdown-symbolic', // Translators: A list of keywords that match the power-off action, separated by semicolons keywords: tokenizeKeywords(_('power off;poweroff;shutdown;halt;stop')), @@ -104,7 +104,7 @@ const SystemActions = GObject.registerClass({ }); this._actions.set(LOCK_SCREEN_ACTION_ID, { // Translators: The name of the lock screen action in search - name: C_("search-result", "Lock Screen"), + name: C_('search-result', 'Lock Screen'), iconName: 'system-lock-screen-symbolic', // Translators: A list of keywords that match the lock screen action, separated by semicolons keywords: tokenizeKeywords(_('lock screen')), @@ -112,7 +112,7 @@ const SystemActions = GObject.registerClass({ }); this._actions.set(LOGOUT_ACTION_ID, { // Translators: The name of the logout action in search - name: C_("search-result", "Log Out"), + name: C_('search-result', 'Log Out'), iconName: 'system-log-out-symbolic', // Translators: A list of keywords that match the logout action, separated by semicolons keywords: tokenizeKeywords(_('logout;log out;sign off')), @@ -120,7 +120,7 @@ const SystemActions = GObject.registerClass({ }); this._actions.set(SUSPEND_ACTION_ID, { // Translators: The name of the suspend action in search - name: C_("search-result", "Suspend"), + name: C_('search-result', 'Suspend'), iconName: 'media-playback-pause-symbolic', // Translators: A list of keywords that match the suspend action, separated by semicolons keywords: tokenizeKeywords(_('suspend;sleep')), @@ -128,7 +128,7 @@ const SystemActions = GObject.registerClass({ }); this._actions.set(SWITCH_USER_ACTION_ID, { // Translators: The name of the switch user action in search - name: C_("search-result", "Switch User"), + name: C_('search-result', 'Switch User'), iconName: 'system-switch-user-symbolic', // Translators: A list of keywords that match the switch user action, separated by semicolons keywords: tokenizeKeywords(_('switch user')), diff --git a/js/misc/util.js b/js/misc/util.js index dbb95e9d5..0894b7251 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -182,7 +182,7 @@ export function trySpawnCommandLine(commandLine) { } function _handleSpawnError(command, err) { - let title = _("Execution of “%s” failed:").format(command); + let title = _('Execution of “%s” failed:').format(command); Main.notifyError(title, err.message); } diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 6a63355a9..2ca82c579 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1770,7 +1770,7 @@ class AppDisplay extends BaseAppView { let appItems = apps.map(id => this._items.get(id).app); let folderName = _findBestFolderName(appItems); if (!folderName) - folderName = _("Unnamed Folder"); + folderName = _('Unnamed Folder'); newFolderSettings.delay(); newFolderSettings.set_string('name', folderName); diff --git a/js/ui/audioDeviceSelection.js b/js/ui/audioDeviceSelection.js index 9034535b5..923eac9c9 100644 --- a/js/ui/audioDeviceSelection.js +++ b/js/ui/audioDeviceSelection.js @@ -71,11 +71,11 @@ const AudioDeviceSelectionDialog = GObject.registerClass({ _getDeviceLabel(device) { switch (device) { case AudioDevice.HEADPHONES: - return _("Headphones"); + return _('Headphones'); case AudioDevice.HEADSET: - return _("Headset"); + return _('Headset'); case AudioDevice.MICROPHONE: - return _("Microphone"); + return _('Microphone'); default: return null; } diff --git a/js/ui/backgroundMenu.js b/js/ui/backgroundMenu.js index 2b22f1e45..25b45ee45 100644 --- a/js/ui/backgroundMenu.js +++ b/js/ui/backgroundMenu.js @@ -12,9 +12,9 @@ export class BackgroundMenu extends PopupMenu.PopupMenu { constructor(layoutManager) { super(layoutManager.dummyCursor, 0, St.Side.TOP); - this.addSettingsAction(_("Change Background…"), 'gnome-background-panel.desktop'); + this.addSettingsAction(_('Change Background…'), 'gnome-background-panel.desktop'); this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this.addSettingsAction(_("Display Settings"), 'gnome-display-panel.desktop'); + this.addSettingsAction(_('Display Settings'), 'gnome-display-panel.desktop'); this.addSettingsAction(_('Settings'), 'org.gnome.Settings.desktop'); this.actor.add_style_class_name('background-menu'); diff --git a/js/ui/barLevel.js b/js/ui/barLevel.js index d0fb3169b..7becf6ce5 100644 --- a/js/ui/barLevel.js +++ b/js/ui/barLevel.js @@ -227,6 +227,6 @@ export const BarLevel = GObject.registerClass({ } _valueChanged() { - this._customAccessible.notify("accessible-value"); + this._customAccessible.notify('accessible-value'); } }); diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 5b2358df5..f20838927 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -37,7 +37,7 @@ function sameDay(dateA, dateB) { function _isWorkDay(date) { /* Translators: Enter 0-6 (Sunday-Saturday) for non-work days. Examples: "0" (Sunday) "6" (Saturday) "06" (Sunday and Saturday). */ - let days = C_('calendar-no-work', "06"); + let days = C_('calendar-no-work', '06'); return !days.includes(date.getDay().toString()); } @@ -63,19 +63,19 @@ function _getCalendarDayAbbreviation(dayNumber) { * NOTE: These grid abbreviations are always shown together * and in order, e.g. "S M T W T F S". */ - NC_("grid sunday", "S"), + NC_('grid sunday', 'S'), /* Translators: Calendar grid abbreviation for Monday */ - NC_("grid monday", "M"), + NC_('grid monday', 'M'), /* Translators: Calendar grid abbreviation for Tuesday */ - NC_("grid tuesday", "T"), + NC_('grid tuesday', 'T'), /* Translators: Calendar grid abbreviation for Wednesday */ - NC_("grid wednesday", "W"), + NC_('grid wednesday', 'W'), /* Translators: Calendar grid abbreviation for Thursday */ - NC_("grid thursday", "T"), + NC_('grid thursday', 'T'), /* Translators: Calendar grid abbreviation for Friday */ - NC_("grid friday", "F"), + NC_('grid friday', 'F'), /* Translators: Calendar grid abbreviation for Saturday */ - NC_("grid saturday", "S"), + NC_('grid saturday', 'S'), ]; return Shell.util_translate_time_string(abbreviations[dayNumber]); } @@ -725,7 +725,7 @@ export const Calendar = GObject.registerClass({ style_class: 'calendar-week-number', can_focus: true, }); - let weekFormat = Shell.util_translate_time_string(N_("Week %V")); + let weekFormat = Shell.util_translate_time_string(N_('Week %V')); label.clutter_text.y_align = Clutter.ActorAlign.CENTER; label.accessible_name = formatDateWithCFormatString(iter, weekFormat); layout.attach(label, rtl ? 7 : 0, row, 1, 1); diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js index eaf816dfc..40df1ea4f 100644 --- a/js/ui/closeDialog.js +++ b/js/ui/closeDialog.js @@ -41,7 +41,7 @@ export const CloseDialog = GObject.registerClass({ let windowApp = tracker.get_window_app(this._window); /* Translators: %s is an application name */ - let title = _("“%s” is not responding.").format(windowApp.get_name()); + let title = _('“%s” is not responding.').format(windowApp.get_name()); let description = _('You may choose to wait a short while for it to ' + 'continue or force the app to quit entirely.'); return new Dialog.MessageDialogContent({ title, description }); @@ -96,13 +96,13 @@ export const CloseDialog = GObject.registerClass({ let surfaceActor = windowActor.get_first_child(); let effect = new Clutter.BrightnessContrastEffect(); effect.set_brightness(FROZEN_WINDOW_BRIGHTNESS); - surfaceActor.add_effect_with_name("gnome-shell-frozen-window", effect); + surfaceActor.add_effect_with_name('gnome-shell-frozen-window', effect); } _removeWindowEffect() { let windowActor = this._window.get_compositor_private(); let surfaceActor = windowActor.get_first_child(); - surfaceActor.remove_effect_by_name("gnome-shell-frozen-window"); + surfaceActor.remove_effect_by_name('gnome-shell-frozen-window'); } _onWait() { diff --git a/js/ui/components/automountManager.js b/js/ui/components/automountManager.js index 59e7357b5..a267823c0 100644 --- a/js/ui/components/automountManager.js +++ b/js/ui/components/automountManager.js @@ -81,7 +81,7 @@ class AutomountManager { let player = global.display.get_sound_player(); player.play_from_theme('device-added-media', - _("External drive connected"), + _('External drive connected'), null); } @@ -93,7 +93,7 @@ class AutomountManager { let player = global.display.get_sound_player(); player.play_from_theme('device-removed-media', - _("External drive disconnected"), + _('External drive disconnected'), null); } @@ -204,8 +204,8 @@ class AutomountManager { this._reaskPassword(volume); } else { if (e.message.includes('Compiled against a version of libcryptsetup that does not support the VeraCrypt PIM setting')) { - Main.notifyError(_("Unable to unlock volume"), - _("The installed udisks version does not support the PIM setting")); + Main.notifyError(_('Unable to unlock volume'), + _('The installed udisks version does not support the PIM setting')); } if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED)) diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js index 90b9c45f8..de53e396a 100644 --- a/js/ui/components/autorunManager.js +++ b/js/ui/components/autorunManager.js @@ -57,7 +57,7 @@ function isMountNonLocal(mount) { if (volume == null) return true; - return volume.get_identifier("class") == "network"; + return volume.get_identifier('class') == 'network'; } function startAppForMount(app, mount) { @@ -316,7 +316,7 @@ class AutorunNotification extends MessageTray.Notification { let label = new St.Bin({ child: new St.Label({ - text: _("Open with %s").format(app.get_name()), + text: _('Open with %s').format(app.get_name()), y_align: Clutter.ActorAlign.CENTER, }), }); diff --git a/js/ui/components/networkAgent.js b/js/ui/components/networkAgent.js index 1db90ccca..6a83e8c8b 100644 --- a/js/ui/components/networkAgent.js +++ b/js/ui/components/networkAgent.js @@ -106,13 +106,13 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog { this.contentLayout.add_child(contentBox); this._okButton = { - label: _("Connect"), + label: _('Connect'), action: this._onOk.bind(this), default: true, }; this.setButtons([{ - label: _("Cancel"), + label: _('Cancel'), action: this.cancel.bind(this), key: Clutter.KEY_Escape, }, this._okButton]); @@ -253,7 +253,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog { let ieee8021xSetting = this._connection.get_setting_802_1x(); /* If hints were given we know exactly what we need to ask */ - if (this._settingName == "802-1x" && this._hints.length) { + if (this._settingName == '802-1x' && this._hints.length) { if (this._hints.includes('identity')) { secrets.push({ label: _('Username'), @@ -370,11 +370,11 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog { wirelessSetting = this._connection.get_setting_wireless(); ssid = NM.utils_ssid_to_utf8(wirelessSetting.get_ssid().get_data()); content.title = _('Authentication required'); - content.message = _("Passwords or encryption keys are required to access the wireless network “%s”.").format(ssid); + content.message = _('Passwords or encryption keys are required to access the wireless network “%s”.').format(ssid); this._getWirelessSecrets(content.secrets, wirelessSetting); break; case '802-3-ethernet': - content.title = _("Wired 802.1X authentication"); + content.title = _('Wired 802.1X authentication'); content.message = null; content.secrets.push({ label: _('Network name'), @@ -385,15 +385,15 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog { this._get8021xSecrets(content.secrets); break; case 'pppoe': - content.title = _("DSL authentication"); + content.title = _('DSL authentication'); content.message = null; this._getPPPoESecrets(content.secrets); break; case 'gsm': if (this._hints.includes('pin')) { let gsmSetting = this._connection.get_setting_gsm(); - content.title = _("PIN code required"); - content.message = _("PIN code is needed for the mobile broadband device"); + content.title = _('PIN code required'); + content.message = _('PIN code is needed for the mobile broadband device'); content.secrets.push({ label: _('PIN'), key: 'pin', @@ -406,7 +406,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog { case 'cdma': case 'bluetooth': content.title = _('Authentication required'); - content.message = _("A password is required to connect to “%s”.").format(connectionSetting.get_id()); + content.message = _('A password is required to connect to “%s”.').format(connectionSetting.get_id()); this._getMobileSecrets(content.secrets, connectionType); break; default: @@ -739,7 +739,7 @@ class NetworkAgent { } _showNotification(requestId, connection, settingName, hints, flags) { - let source = new MessageTray.Source(_("Network Manager"), 'network-transmit-receive'); + let source = new MessageTray.Source(_('Network Manager'), 'network-transmit-receive'); source.policy = new MessageTray.NotificationApplicationPolicy('gnome-network-panel'); let title, body; @@ -751,32 +751,32 @@ class NetworkAgent { let wirelessSetting = connection.get_setting_wireless(); let ssid = NM.utils_ssid_to_utf8(wirelessSetting.get_ssid().get_data()); title = _('Authentication required'); - body = _("Passwords or encryption keys are required to access the wireless network “%s”.").format(ssid); + body = _('Passwords or encryption keys are required to access the wireless network “%s”.').format(ssid); break; } case '802-3-ethernet': - title = _("Wired 802.1X authentication"); + title = _('Wired 802.1X authentication'); body = _('A password is required to connect to “%s”.').format(connection.get_id()); break; case 'pppoe': - title = _("DSL authentication"); + title = _('DSL authentication'); body = _('A password is required to connect to “%s”.').format(connection.get_id()); break; case 'gsm': if (hints.includes('pin')) { - title = _("PIN code required"); - body = _("PIN code is needed for the mobile broadband device"); + title = _('PIN code required'); + body = _('PIN code is needed for the mobile broadband device'); break; } // fall through case 'cdma': case 'bluetooth': title = _('Authentication required'); - body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id()); + body = _('A password is required to connect to “%s”.').format(connectionSetting.get_id()); break; case 'vpn': - title = _("VPN password"); - body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id()); + title = _('VPN password'); + body = _('A password is required to connect to “%s”.').format(connectionSetting.get_id()); break; default: log(`Invalid connection type: ${connectionType}`); diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 9c06e5ca0..9fdda4ac7 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -43,7 +43,7 @@ const AuthenticationDialog = GObject.registerClass({ this.connect('closed', this._onDialogClosed.bind(this)); - let title = _("Authentication Required"); + let title = _('Authentication Required'); let headerContent = new Dialog.MessageDialogContent({ title, description }); this.contentLayout.add_child(headerContent); @@ -94,7 +94,7 @@ const AuthenticationDialog = GObject.registerClass({ this._passwordEntry = new St.PasswordEntry({ style_class: 'prompt-dialog-password-entry', - text: "", + text: '', can_focus: true, visible: false, x_align: Clutter.ActorAlign.CENTER, @@ -262,7 +262,7 @@ const AuthenticationDialog = GObject.registerClass({ * requested authentication was not gained; this can happen * because of an authentication error (like invalid password), * for instance. */ - this._errorMessageLabel.set_text(_("Sorry, that didn’t work. Please try again.")); + this._errorMessageLabel.set_text(_('Sorry, that didn’t work. Please try again.')); this._errorMessageLabel.show(); this._infoMessageLabel.hide(); this._nullMessageLabel.hide(); diff --git a/js/ui/dash.js b/js/ui/dash.js index 1731dd81e..cc55d02f9 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -75,7 +75,7 @@ class DashItemContainer extends St.Widget { x_align: Clutter.ActorAlign.CENTER, }); - this._labelText = ""; + this._labelText = ''; this.label = new St.Label({ style_class: 'dash-label' }); this.label.hide(); Main.layoutManager.addChrome(this.label); @@ -405,7 +405,7 @@ export const Dash = GObject.registerClass({ // Translators: this is the name of the dock/favorites area on // the left of the overview - Main.ctrlAltTabManager.addGroup(this, _("Dash"), 'user-bookmarks-symbolic'); + Main.ctrlAltTabManager.addGroup(this, _('Dash'), 'user-bookmarks-symbolic'); } _onItemDragBegin() { diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 229303954..1b808bef1 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -695,7 +695,7 @@ class _Draggable extends Signals.EventEmitter { this._dragActor, targX, targY, event.get_time()); } catch (e) { // On error, skip this target - logError(e, "Skipping drag target"); + logError(e, 'Skipping drag target'); } if (accepted) { // If it accepted the drop without taking the actor, diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index b4022918e..14faa298d 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -43,8 +43,8 @@ const LOW_BATTERY_THRESHOLD = 30; const EndSessionDialogIface = loadInterfaceXML('org.gnome.SessionManager.EndSessionDialog'); const logoutDialogContent = { - subjectWithUser: C_("title", "Log Out %s"), - subject: C_("title", "Log Out"), + subjectWithUser: C_('title', 'Log Out %s'), + subject: C_('title', 'Log Out'), descriptionWithUser(user, seconds) { return ngettext( '%s will be logged out automatically in %d second.', @@ -66,15 +66,15 @@ const logoutDialogContent = { }; const shutdownDialogContent = { - subject: C_("title", "Power Off"), - subjectWithUpdates: C_("title", "Install Updates & Power Off"), + subject: C_('title', 'Power Off'), + subjectWithUpdates: C_('title', 'Install Updates & Power Off'), description(seconds) { return ngettext( 'The system will power off automatically in %d second.', 'The system will power off automatically in %d seconds.', seconds).format(seconds); }, - checkBoxText: C_("checkbox", "Install pending software updates"), + checkBoxText: C_('checkbox', 'Install pending software updates'), showBatteryWarning: true, confirmButtons: [{ signal: 'ConfirmedShutdown', @@ -85,7 +85,7 @@ const shutdownDialogContent = { }; const restartDialogContent = { - subject: C_("title", "Restart"), + subject: C_('title', 'Restart'), subjectWithUpdates: C_('title', 'Install Updates & Restart'), description(seconds) { return ngettext( @@ -105,7 +105,7 @@ const restartDialogContent = { const restartUpdateDialogContent = { - subject: C_("title", "Restart & Install Updates"), + subject: C_('title', 'Restart & Install Updates'), description(seconds) { return ngettext( 'The system will automatically restart and install updates in %d second.', @@ -117,20 +117,20 @@ const restartUpdateDialogContent = { signal: 'ConfirmedReboot', label: C_('button', 'Restart & Install'), }], - unusedFutureButtonForTranslation: C_("button", "Install & Power Off"), - unusedFutureCheckBoxForTranslation: C_("checkbox", "Power off after updates are installed"), + unusedFutureButtonForTranslation: C_('button', 'Install & Power Off'), + unusedFutureCheckBoxForTranslation: C_('checkbox', 'Power off after updates are installed'), iconName: 'view-refresh-symbolic', showOtherSessions: true, }; const restartUpgradeDialogContent = { - subject: C_("title", "Restart & Install Upgrade"), + subject: C_('title', 'Restart & Install Upgrade'), upgradeDescription(distroName, distroVersion) { /* Translators: This is the text displayed for system upgrades in the shut down dialog. First %s gets replaced with the distro name and second %s with the distro version to upgrade to */ - return _("%s %s will be installed after restart. Upgrade installation can take a long time: ensure that you have backed up and that the computer is plugged in.").format(distroName, distroVersion); + return _('%s %s will be installed after restart. Upgrade installation can take a long time: ensure that you have backed up and that the computer is plugged in.').format(distroName, distroVersion); }, disableTimer: true, showBatteryWarning: false, @@ -749,7 +749,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog { if (!(this._type in DialogContent)) { invocation.return_dbus_error('org.gnome.Shell.ModalDialog.TypeError', - "Unknown dialog type requested"); + 'Unknown dialog type requested'); return; } @@ -782,7 +782,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog { if (!this.open(timestamp)) { invocation.return_dbus_error('org.gnome.Shell.ModalDialog.GrabError', - "Cannot grab pointer and keyboard"); + 'Cannot grab pointer and keyboard'); return; } diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 3dbb6b3f8..9c23a3bfb 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -509,7 +509,7 @@ export class ExtensionManager extends Signals.EventEmitter { let extension = this.lookup(uuid); if (!extension) - throw new Error("Extension was not properly created. Call createExtensionObject first"); + throw new Error('Extension was not properly created. Call createExtensionObject first'); let dir = extension.dir; let extensionJs = dir.get_child('extension.js'); diff --git a/js/ui/kbdA11yDialog.js b/js/ui/kbdA11yDialog.js index 5d0a955f6..e04d83fc1 100644 --- a/js/ui/kbdA11yDialog.js +++ b/js/ui/kbdA11yDialog.js @@ -31,21 +31,21 @@ class KbdA11yDialog extends GObject.Object { key = KEY_SLOW_KEYS_ENABLED; enabled = (newFlags & Meta.KeyboardA11yFlags.SLOW_KEYS_ENABLED) > 0; title = enabled - ? _("Slow Keys Turned On") - : _("Slow Keys Turned Off"); + ? _('Slow Keys Turned On') + : _('Slow Keys Turned Off'); description = _('You just held down the Shift key for 8 seconds. This is the shortcut ' + 'for the Slow Keys feature, which affects the way your keyboard works.'); } else if (whatChanged & Meta.KeyboardA11yFlags.STICKY_KEYS_ENABLED) { key = KEY_STICKY_KEYS_ENABLED; enabled = (newFlags & Meta.KeyboardA11yFlags.STICKY_KEYS_ENABLED) > 0; title = enabled - ? _("Sticky Keys Turned On") - : _("Sticky Keys Turned Off"); + ? _('Sticky Keys Turned On') + : _('Sticky Keys Turned Off'); description = enabled - ? _("You just pressed the Shift key 5 times in a row. This is the shortcut " + - "for the Sticky Keys feature, which affects the way your keyboard works.") - : _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. " + - "This turns off the Sticky Keys feature, which affects the way your keyboard works."); + ? _('You just pressed the Shift key 5 times in a row. This is the shortcut ' + + 'for the Sticky Keys feature, which affects the way your keyboard works.') + : _('You just pressed two keys at once, or pressed the Shift key 5 times in a row. ' + + 'This turns off the Sticky Keys feature, which affects the way your keyboard works.'); } else { return; } diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 2b1cc0721..f9b1f0a5e 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -784,17 +784,17 @@ const Extensions = GObject.registerClass({ errorDisplay.add(new St.Label({ text: errors[i] })); } else { /* Translators: argument is an extension UUID. */ - let message = _("%s has not emitted any errors.").format(extension.uuid); + let message = _('%s has not emitted any errors.').format(extension.uuid); errorDisplay.add(new St.Label({ text: message })); } actor._errorDisplay = errorDisplay; actor._parentBox.add(errorDisplay); - actor.label = _("Hide Errors"); + actor.label = _('Hide Errors'); } else { actor._errorDisplay.destroy(); actor._errorDisplay = null; - actor.label = _("Show Errors"); + actor.label = _('Show Errors'); } actor._isShowing = shouldShow; diff --git a/js/ui/main.js b/js/ui/main.js index 011b77bb5..6742b7f4a 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -337,7 +337,7 @@ async function _initializeUI() { LoginManager.registerSessionWithGDM(); if (perfModule) { - let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT"); + let perfOutput = GLib.getenv('SHELL_PERF_OUTPUT'); Scripting.runPerfScript(perfModule, perfOutput); } }); diff --git a/js/ui/messageList.js b/js/ui/messageList.js index cb6e185c7..a097a7c1d 100644 --- a/js/ui/messageList.js +++ b/js/ui/messageList.js @@ -657,7 +657,7 @@ export const MessageListSection = GObject.registerClass({ moveMessage(message, index, animate) { if (!this._messages.includes(message)) - throw new Error(`Impossible to move untracked message`); + throw new Error('Impossible to move untracked message'); let listItem = message.get_parent(); @@ -688,7 +688,7 @@ export const MessageListSection = GObject.registerClass({ const messages = this._messages; if (!messages.includes(message)) - throw new Error(`Impossible to remove untracked message`); + throw new Error('Impossible to remove untracked message'); let listItem = message.get_parent(); listItem._connectionsIds.forEach(id => message.disconnect(id)); diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index f333dcb13..f86aae14f 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1421,7 +1421,7 @@ export const MessageTray = GObject.registerClass({ export const SystemNotificationSource = GObject.registerClass( class SystemNotificationSource extends Source { _init() { - super._init(_("System Information"), 'dialog-information-symbolic'); + super._init(_('System Information'), 'dialog-information-symbolic'); } open() { diff --git a/js/ui/mpris.js b/js/ui/mpris.js index d6faab33b..8831289a4 100644 --- a/js/ui/mpris.js +++ b/js/ui/mpris.js @@ -202,7 +202,7 @@ export class MprisPlayer extends Signals.EventEmitter { this._busName}; expected an array of strings, got ${ this._trackArtists} (${typeof this._trackArtists})`); } - this._trackArtists = [_("Unknown artist")]; + this._trackArtists = [_('Unknown artist')]; } this._trackTitle = metadata['xesam:title']; @@ -212,7 +212,7 @@ export class MprisPlayer extends Signals.EventEmitter { this._busName}; expected a string, got ${ this._trackTitle} (${typeof this._trackTitle})`); } - this._trackTitle = _("Unknown title"); + this._trackTitle = _('Unknown title'); } this._trackCoverUrl = metadata['mpris:artUrl']; diff --git a/js/ui/overview.js b/js/ui/overview.js index 444629ba2..5c52ae595 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -73,7 +73,7 @@ class OverviewActor extends St.BoxLayout { name: 'overview', /* Translators: This is the main view to select activities. See also note for "Activities" string. */ - accessible_name: _("Overview"), + accessible_name: _('Overview'), vertical: true, }); diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js index fd25c469e..47f3c6451 100644 --- a/js/ui/padOsd.js +++ b/js/ui/padOsd.js @@ -19,7 +19,7 @@ import * as Layout from './layout.js'; import {loadInterfaceXML} from '../misc/fileUtils.js'; -const ACTIVE_COLOR = "#729fcf"; +const ACTIVE_COLOR = '#729fcf'; const LTR = 0; const RTL = 1; @@ -846,11 +846,11 @@ export const PadOsd = GObject.registerClass({ let title; if (this._editionMode) { - title = _("Press a button to configure"); - this._tipLabel.set_text(_("Press Esc to exit")); + title = _('Press a button to configure'); + this._tipLabel.set_text(_('Press Esc to exit')); } else { title = this.padDevice.get_device_name(); - this._tipLabel.set_text(_("Press any key to exit")); + this._tipLabel.set_text(_('Press any key to exit')); } this._titleLabel.set_text(title); @@ -966,7 +966,7 @@ export class PadOsdService extends Signals.EventEmitter { if (padDevice == null) { invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED, - "Invalid params"); + 'Invalid params'); return; } diff --git a/js/ui/panel.js b/js/ui/panel.js index 6b1b63eb1..641e2fbcd 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -71,7 +71,7 @@ const AppMenuButton = GObject.registerClass({ let bin = new St.Bin({ name: 'appMenu' }); this.add_actor(bin); - this.bind_property("reactive", this, "can-focus", 0); + this.bind_property('reactive', this, 'can-focus', 0); this.reactive = false; this._container = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); @@ -496,7 +496,7 @@ class Panel extends St.Widget { }); Main.layoutManager.panelBox.add(this); - Main.ctrlAltTabManager.addGroup(this, _("Top Bar"), 'focus-top-bar-symbolic', + Main.ctrlAltTabManager.addGroup(this, _('Top Bar'), 'focus-top-bar-symbolic', { sortGroup: CtrlAltTab.SortGroup.TOP }); Main.sessionMode.connect('updated', this._updatePanel.bind(this)); diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index c15b74c3d..8bcb6d6ce 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -757,7 +757,7 @@ export class PopupMenuBase extends Signals.EventEmitter { } else if (menuItem instanceof PopupBaseMenuItem) { this._connectItemSignals(menuItem); } else { - throw TypeError("Invalid argument to PopupMenuBase.addMenuItem()"); + throw TypeError('Invalid argument to PopupMenuBase.addMenuItem()'); } menuItem._setParent(this); diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 829c28ee5..e47655a47 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -2462,7 +2462,7 @@ export class ScreenshotService { if (!this._checkArea(x, y, width, height)) { invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED, - "Invalid params"); + 'Invalid params'); return; } let screenshot = await this._createScreenshot(invocation); @@ -2567,7 +2567,7 @@ export class ScreenshotService { if (!this._checkArea(x, y, width, height)) { invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED, - "Invalid params"); + 'Invalid params'); return; } let flashspot = new Flashspot({ x, y, width, height }); diff --git a/js/ui/scripting.js b/js/ui/scripting.js index 1ef001669..d0413e609 100644 --- a/js/ui/scripting.js +++ b/js/ui/scripting.js @@ -174,7 +174,7 @@ export async function disableHelperAutoExit() { export function defineScriptEvent(name, description) { Shell.PerfLog.get_default().define_event(`script.${name}`, description, - ""); + ''); } /** @@ -222,7 +222,7 @@ function _collect(scriptModule, outputFile) { Gio.FileCreateFlags.NONE, null); let out = Gio.BufferedOutputStream.new_sized(raw, 4096); - Shell.write_string_to_stream(out, "{\n"); + Shell.write_string_to_stream(out, '{\n'); Shell.write_string_to_stream(out, '"events":\n'); Shell.PerfLog.get_default().dump_events(out); diff --git a/js/ui/search.js b/js/ui/search.js index 066d8b380..3532f9e90 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -814,9 +814,9 @@ export const SearchResultsView = GObject.registerClass({ if (!haveResults) { if (this.searchInProgress) - this._statusText.set_text(_("Searching…")); + this._statusText.set_text(_('Searching…')); else - this._statusText.set_text(_("No results.")); + this._statusText.set_text(_('No results.')); } } @@ -947,7 +947,7 @@ class ProviderInfo extends St.Button { } setMoreCount(count) { - this._moreLabel.text = ngettext("%d more", "%d more", count).format(count); + this._moreLabel.text = ngettext('%d more', '%d more', count).format(count); this._moreLabel.visible = count > 0; } }); diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js index e2596df3d..bdb15d224 100644 --- a/js/ui/sessionMode.js +++ b/js/ui/sessionMode.js @@ -172,7 +172,7 @@ export class SessionMode extends Signals.EventEmitter { popMode(mode) { if (this.currentMode != mode || this._modeStack.length === 1) - throw new Error("Invalid SessionMode.popMode"); + throw new Error('Invalid SessionMode.popMode'); console.debug(`sessionMode: Popping mode ${mode}`); this._modeStack.pop(); diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js index 6eba2a724..df5b18cc2 100644 --- a/js/ui/shellEntry.js +++ b/js/ui/shellEntry.js @@ -20,12 +20,12 @@ export class EntryMenu extends PopupMenu.PopupMenu { // Populate menu let item; - item = new PopupMenu.PopupMenuItem(_("Copy")); + item = new PopupMenu.PopupMenuItem(_('Copy')); item.connect('activate', this._onCopyActivated.bind(this)); this.addMenuItem(item); this._copyItem = item; - item = new PopupMenu.PopupMenuItem(_("Paste")); + item = new PopupMenu.PopupMenuItem(_('Paste')); item.connect('activate', this._onPasteActivated.bind(this)); this.addMenuItem(item); this._pasteItem = item; @@ -77,9 +77,9 @@ export class EntryMenu extends PopupMenu.PopupMenu { _updatePasswordItem() { if (!this._entry.password_visible) - this._passwordItem.label.set_text(_("Show Text")); + this._passwordItem.label.set_text(_('Show Text')); else - this._passwordItem.label.set_text(_("Hide Text")); + this._passwordItem.label.set_text(_('Hide Text')); } _onCopyActivated() { diff --git a/js/ui/status/accessibility.js b/js/ui/status/accessibility.js index 783ce20b6..c205a3f6f 100644 --- a/js/ui/status/accessibility.js +++ b/js/ui/status/accessibility.js @@ -33,7 +33,7 @@ const KEY_HIGH_CONTRAST = 'high-contrast'; export const ATIndicator = GObject.registerClass( class ATIndicator extends PanelMenu.Button { _init() { - super._init(0.5, _("Accessibility")); + super._init(0.5, _('Accessibility')); this.add_child(new St.Icon({ style_class: 'system-status-icon', @@ -46,31 +46,31 @@ class ATIndicator extends PanelMenu.Button { let highContrast = this._buildItem(_('High Contrast'), A11Y_INTERFACE_SCHEMA, KEY_HIGH_CONTRAST); this.menu.addMenuItem(highContrast); - let magnifier = this._buildItem(_("Zoom"), APPLICATIONS_SCHEMA, + let magnifier = this._buildItem(_('Zoom'), APPLICATIONS_SCHEMA, 'screen-magnifier-enabled'); this.menu.addMenuItem(magnifier); let textZoom = this._buildFontItem(); this.menu.addMenuItem(textZoom); - let screenReader = this._buildItem(_("Screen Reader"), APPLICATIONS_SCHEMA, + let screenReader = this._buildItem(_('Screen Reader'), APPLICATIONS_SCHEMA, 'screen-reader-enabled'); this.menu.addMenuItem(screenReader); - let screenKeyboard = this._buildItem(_("Screen Keyboard"), APPLICATIONS_SCHEMA, + let screenKeyboard = this._buildItem(_('Screen Keyboard'), APPLICATIONS_SCHEMA, 'screen-keyboard-enabled'); this.menu.addMenuItem(screenKeyboard); - let visualBell = this._buildItem(_("Visual Alerts"), WM_SCHEMA, KEY_VISUAL_BELL); + let visualBell = this._buildItem(_('Visual Alerts'), WM_SCHEMA, KEY_VISUAL_BELL); this.menu.addMenuItem(visualBell); - let stickyKeys = this._buildItem(_("Sticky Keys"), A11Y_KEYBOARD_SCHEMA, KEY_STICKY_KEYS_ENABLED); + let stickyKeys = this._buildItem(_('Sticky Keys'), A11Y_KEYBOARD_SCHEMA, KEY_STICKY_KEYS_ENABLED); this.menu.addMenuItem(stickyKeys); - let slowKeys = this._buildItem(_("Slow Keys"), A11Y_KEYBOARD_SCHEMA, KEY_SLOW_KEYS_ENABLED); + let slowKeys = this._buildItem(_('Slow Keys'), A11Y_KEYBOARD_SCHEMA, KEY_SLOW_KEYS_ENABLED); this.menu.addMenuItem(slowKeys); - let bounceKeys = this._buildItem(_("Bounce Keys"), A11Y_KEYBOARD_SCHEMA, KEY_BOUNCE_KEYS_ENABLED); + let bounceKeys = this._buildItem(_('Bounce Keys'), A11Y_KEYBOARD_SCHEMA, KEY_BOUNCE_KEYS_ENABLED); this.menu.addMenuItem(bounceKeys); let mouseKeys = this._buildItem(_('Mouse Keys'), A11Y_KEYBOARD_SCHEMA, KEY_MOUSE_KEYS_ENABLED); @@ -134,7 +134,7 @@ class ATIndicator extends PanelMenu.Button { let settings = new Gio.Settings({ schema_id: DESKTOP_INTERFACE_SCHEMA }); let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR); let initialSetting = factor > 1.0; - let widget = this._buildItemExtended(_("Large Text"), + let widget = this._buildItemExtended(_('Large Text'), initialSetting, settings.is_writable(KEY_TEXT_SCALING_FACTOR), enabled => { diff --git a/js/ui/status/dwellClick.js b/js/ui/status/dwellClick.js index 2782049c2..edb7df16f 100644 --- a/js/ui/status/dwellClick.js +++ b/js/ui/status/dwellClick.js @@ -12,22 +12,22 @@ const KEY_DWELL_MODE = 'dwell-mode'; const DWELL_MODE_WINDOW = 'window'; const DWELL_CLICK_MODES = { primary: { - name: _("Single Click"), + name: _('Single Click'), icon: 'pointer-primary-click-symbolic', type: Clutter.PointerA11yDwellClickType.PRIMARY, }, double: { - name: _("Double Click"), + name: _('Double Click'), icon: 'pointer-double-click-symbolic', type: Clutter.PointerA11yDwellClickType.DOUBLE, }, drag: { - name: _("Drag"), + name: _('Drag'), icon: 'pointer-drag-symbolic', type: Clutter.PointerA11yDwellClickType.DRAG, }, secondary: { - name: _("Secondary Click"), + name: _('Secondary Click'), icon: 'pointer-secondary-click-symbolic', type: Clutter.PointerA11yDwellClickType.SECONDARY, }, @@ -36,7 +36,7 @@ const DWELL_CLICK_MODES = { export const DwellClickIndicator = GObject.registerClass( class DwellClickIndicator extends PanelMenu.Button { _init() { - super._init(0.5, _("Dwell Click")); + super._init(0.5, _('Dwell Click')); this._icon = new St.Icon({ style_class: 'system-status-icon', diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js index 22cd25d0b..c58ffe378 100644 --- a/js/ui/status/keyboard.js +++ b/js/ui/status/keyboard.js @@ -330,13 +330,13 @@ export class InputSourceManager extends Signals.EventEmitter { this._mruSourcesBackup = null; this._keybindingAction = Main.wm.addKeybinding('switch-input-source', - new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings" }), + new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.keybindings' }), Meta.KeyBindingFlags.NONE, Shell.ActionMode.ALL, this._switchInputSource.bind(this)); this._keybindingActionBackward = Main.wm.addKeybinding('switch-input-source-backward', - new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings" }), + new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.keybindings' }), Meta.KeyBindingFlags.IS_REVERSED, Shell.ActionMode.ALL, this._switchInputSource.bind(this)); @@ -850,7 +850,7 @@ class InputSourceIndicatorContainer extends St.Widget { export const InputSourceIndicator = GObject.registerClass( class InputSourceIndicator extends PanelMenu.Button { _init() { - super._init(0.5, _("Keyboard")); + super._init(0.5, _('Keyboard')); this.connect('destroy', this._onDestroy.bind(this)); @@ -867,7 +867,7 @@ class InputSourceIndicator extends PanelMenu.Button { this._propSection.actor.hide(); this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this._showLayoutItem = this.menu.addAction(_("Show Keyboard Layout"), this._showLayout.bind(this)); + this._showLayoutItem = this.menu.addAction(_('Show Keyboard Layout'), this._showLayout.bind(this)); this.menu.addSettingsAction(_('Keyboard Settings'), 'gnome-keyboard-panel.desktop'); diff --git a/js/ui/status/location.js b/js/ui/status/location.js index 5db10dc0c..3dedcc4ce 100644 --- a/js/ui/status/location.js +++ b/js/ui/status/location.js @@ -279,7 +279,7 @@ class AppAuthorizer { _userAuthorizeApp() { let name = this._app.get_name(); let appInfo = this._app.get_app_info(); - let reason = appInfo.get_locale_string("X-Geoclue-Reason"); + let reason = appInfo.get_locale_string('X-Geoclue-Reason'); this._dialog = new GeolocationDialog(name, reason, this.reqAccuracyLevel); diff --git a/js/ui/status/network.js b/js/ui/status/network.js index fec78bd1d..48cb2759e 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -58,7 +58,7 @@ function signalToIcon(value) { function ssidToLabel(ssid) { let label = NM.utils_ssid_to_utf8(ssid.get_data()); if (!label) - label = _(""); + label = _(''); return label; } diff --git a/js/ui/status/thunderbolt.js b/js/ui/status/thunderbolt.js index fe1712496..218ff58dd 100644 --- a/js/ui/status/thunderbolt.js +++ b/js/ui/status/thunderbolt.js @@ -258,7 +258,7 @@ class Indicator extends SystemIndicator { _ensureSource() { if (!this._source) { - this._source = new MessageTray.Source(_("Thunderbolt"), + this._source = new MessageTray.Source(_('Thunderbolt'), 'thunderbolt-symbolic'); this._source.connect('destroy', () => (this._source = null)); @@ -319,19 +319,19 @@ class Indicator extends SystemIndicator { return; /* we are done */ if (!unlocked) { - const title = _("Unknown Thunderbolt device"); - const body = _("New device has been detected while you were away. Please disconnect and reconnect the device to start using it."); + const title = _('Unknown Thunderbolt device'); + const body = _('New device has been detected while you were away. Please disconnect and reconnect the device to start using it.'); this._notify(title, body); } else { - const title = _("Unauthorized Thunderbolt device"); - const body = _("New device has been detected and needs to be authorized by an administrator."); + const title = _('Unauthorized Thunderbolt device'); + const body = _('New device has been detected and needs to be authorized by an administrator.'); this._notify(title, body); } } _onEnrollFailed(obj, device, error) { - const title = _("Thunderbolt authorization error"); - const body = _("Could not authorize the Thunderbolt device: %s").format(error.message); + const title = _('Thunderbolt authorization error'); + const body = _('Could not authorize the Thunderbolt device: %s').format(error.message); this._notify(title, body); } }); diff --git a/js/ui/windowAttentionHandler.js b/js/ui/windowAttentionHandler.js index 2005c24ef..09ffeb6e5 100644 --- a/js/ui/windowAttentionHandler.js +++ b/js/ui/windowAttentionHandler.js @@ -17,7 +17,7 @@ export class WindowAttentionHandler { _getTitleAndBanner(app, window) { let title = app.get_name(); - let banner = _("“%s” is ready").format(window.get_title()); + let banner = _('“%s” is ready').format(window.get_title()); return [title, banner]; } diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index e401b1cca..187f93c98 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -50,7 +50,7 @@ const GSD_WACOM_OBJECT_PATH = '/org/gnome/SettingsDaemon/Wacom'; const GsdWacomIface = loadInterfaceXML('org.gnome.SettingsDaemon.Wacom'); const GsdWacomProxy = Gio.DBusProxy.makeProxyWrapper(GsdWacomIface); -const WINDOW_DIMMER_EFFECT_NAME = "gnome-shell-window-dimmer"; +const WINDOW_DIMMER_EFFECT_NAME = 'gnome-shell-window-dimmer'; Gio._promisify(Shell, 'util_start_systemd_unit'); Gio._promisify(Shell, 'util_stop_systemd_unit'); @@ -550,7 +550,7 @@ class ResizePopup extends St.Widget { set(rect, displayW, displayH) { /* Translators: This represents the size of a window. The first number is * the width of the window and the second is the height. */ - let text = _("%d × %d").format(displayW, displayH); + let text = _('%d × %d').format(displayW, displayH); this._label.set_text(text); this.set_position(rect.x, rect.y); diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js index 1b6d0519d..0fa66ef79 100644 --- a/js/ui/windowMenu.js +++ b/js/ui/windowMenu.js @@ -50,7 +50,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { window.unmaximize(Meta.MaximizeFlags.BOTH); }); } else { - item = this.addAction(_("Maximize"), () => { + item = this.addAction(_('Maximize'), () => { window.maximize(Meta.MaximizeFlags.BOTH); }); } @@ -96,12 +96,12 @@ export class WindowMenu extends PopupMenu.PopupMenu { item.setSensitive(false); if (!window.titlebar_is_onscreen() && type != Meta.WindowType.DOCK && type != Meta.WindowType.DESKTOP) { - this.addAction(_("Move Titlebar Onscreen"), () => { + this.addAction(_('Move Titlebar Onscreen'), () => { window.shove_titlebar_onscreen(); }); } - item = this.addAction(_("Always on Top"), () => { + item = this.addAction(_('Always on Top'), () => { if (window.is_above()) window.unmake_above(); else @@ -120,7 +120,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { window.is_on_primary_monitor())) { let isSticky = window.is_on_all_workspaces(); - item = this.addAction(_("Always on Visible Workspace"), () => { + item = this.addAction(_('Always on Visible Workspace'), () => { if (isSticky) window.unstick(); else @@ -134,25 +134,25 @@ export class WindowMenu extends PopupMenu.PopupMenu { if (!isSticky) { let workspace = window.get_workspace(); if (workspace != workspace.get_neighbor(Meta.MotionDirection.LEFT)) { - this.addAction(_("Move to Workspace Left"), () => { + this.addAction(_('Move to Workspace Left'), () => { let dir = Meta.MotionDirection.LEFT; window.change_workspace(workspace.get_neighbor(dir)); }); } if (workspace != workspace.get_neighbor(Meta.MotionDirection.RIGHT)) { - this.addAction(_("Move to Workspace Right"), () => { + this.addAction(_('Move to Workspace Right'), () => { let dir = Meta.MotionDirection.RIGHT; window.change_workspace(workspace.get_neighbor(dir)); }); } if (workspace != workspace.get_neighbor(Meta.MotionDirection.UP)) { - this.addAction(_("Move to Workspace Up"), () => { + this.addAction(_('Move to Workspace Up'), () => { let dir = Meta.MotionDirection.UP; window.change_workspace(workspace.get_neighbor(dir)); }); } if (workspace != workspace.get_neighbor(Meta.MotionDirection.DOWN)) { - this.addAction(_("Move to Workspace Down"), () => { + this.addAction(_('Move to Workspace Down'), () => { let dir = Meta.MotionDirection.DOWN; window.change_workspace(workspace.get_neighbor(dir)); }); @@ -170,7 +170,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { let upMonitorIndex = display.get_monitor_neighbor_index(monitorIndex, dir); if (upMonitorIndex != -1) { - this.addAction(_("Move to Monitor Up"), () => { + this.addAction(_('Move to Monitor Up'), () => { window.move_to_monitor(upMonitorIndex); }); } @@ -179,7 +179,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { let downMonitorIndex = display.get_monitor_neighbor_index(monitorIndex, dir); if (downMonitorIndex != -1) { - this.addAction(_("Move to Monitor Down"), () => { + this.addAction(_('Move to Monitor Down'), () => { window.move_to_monitor(downMonitorIndex); }); } @@ -188,7 +188,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { let leftMonitorIndex = display.get_monitor_neighbor_index(monitorIndex, dir); if (leftMonitorIndex != -1) { - this.addAction(_("Move to Monitor Left"), () => { + this.addAction(_('Move to Monitor Left'), () => { window.move_to_monitor(leftMonitorIndex); }); } @@ -197,7 +197,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { let rightMonitorIndex = display.get_monitor_neighbor_index(monitorIndex, dir); if (rightMonitorIndex != -1) { - this.addAction(_("Move to Monitor Right"), () => { + this.addAction(_('Move to Monitor Right'), () => { window.move_to_monitor(rightMonitorIndex); }); } @@ -205,7 +205,7 @@ export class WindowMenu extends PopupMenu.PopupMenu { this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - item = this.addAction(_("Close"), event => { + item = this.addAction(_('Close'), event => { window.delete(event.get_time()); }); if (!window.can_close()) diff --git a/lint/eslintrc-legacy.yml b/lint/eslintrc-legacy.yml index 9249ffcf6..42da0c6fc 100644 --- a/lint/eslintrc-legacy.yml +++ b/lint/eslintrc-legacy.yml @@ -21,4 +21,3 @@ rules: object-curly-spacing: - error - always - quotes: off