From c76e19037c4461b1a562cc589353594de6befc58 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 10 Aug 2025 14:52:25 -0400 Subject: [PATCH] Ensure i18n is used with double quotes and add CI check Apparently i18n doesn't support string literals with single quotes as parameters. Fix occurrences of this and add a CI check to ensure this won't happen in the future. --- .gitlab-ci.yml | 1 + containments/homescreens/folio/qml/HomeScreenPage.qml | 2 +- .../homescreens/folio/qml/delegate/WidgetDelegate.qml | 4 ++-- .../folio/qml/delegate/WidgetDelegateConfig.qml | 8 ++++---- .../folio/qml/private/ConfirmDeleteFolderDialogLoader.qml | 4 ++-- .../homescreens/folio/qml/settings/SettingsComponent.qml | 6 +++--- .../homescreens/folio/qml/settings/SettingsWindow.qml | 8 ++++---- .../homescreens/halcyon/qml/settings/SettingsScreen.qml | 4 ++-- .../wifi/package/contents/ui/ConnectionItemDelegate.qml | 8 ++++---- kcms/waydroidintegration/ui/WaydroidConfigurationForm.qml | 6 +++--- kwin/mobiletaskswitcher/package/contents/ui/main.qml | 4 ++-- 11 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb67ee1e..5b1594d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,7 @@ include: - /gitlab-templates/alpine-qt6.yml - /gitlab-templates/xml-lint.yml - /gitlab-templates/yaml-lint.yml + - /gitlab-templates/qml-lint.yml posix-script-compliance: image: diff --git a/containments/homescreens/folio/qml/HomeScreenPage.qml b/containments/homescreens/folio/qml/HomeScreenPage.qml index a61aad77..7cb92c10 100644 --- a/containments/homescreens/folio/qml/HomeScreenPage.qml +++ b/containments/homescreens/folio/qml/HomeScreenPage.qml @@ -374,7 +374,7 @@ Item { PC3.ToolTip { visible: widgetDelegate.editMode && pressed - text: i18n('Release to configure, drag to move') + text: i18n("Release to configure, drag to move") } WidgetDelegateConfig { diff --git a/containments/homescreens/folio/qml/delegate/WidgetDelegate.qml b/containments/homescreens/folio/qml/delegate/WidgetDelegate.qml index 6d83ee98..82044bdd 100644 --- a/containments/homescreens/folio/qml/delegate/WidgetDelegate.qml +++ b/containments/homescreens/folio/qml/delegate/WidgetDelegate.qml @@ -116,7 +116,7 @@ Folio.WidgetContainer { visible: root.widget && !root.widget.visualApplet color: 'white' wrapMode: Text.Wrap - text: i18n('This widget was not found.') + text: i18n("This widget was not found.") horizontalAlignment: Text.AlignHCenter anchors.left: parent.left @@ -134,7 +134,7 @@ Folio.WidgetContainer { PC3.Button { id: configurationRequiredButton anchors.centerIn: parent - text: i18n('Configure…') + text: i18n("Configure…") icon.name: 'configure' visible: root.widget && root.widget.applet && root.widget.applet.configurationRequired onClicked: root.widget.applet.internalAction('configure').trigger(); diff --git a/containments/homescreens/folio/qml/delegate/WidgetDelegateConfig.qml b/containments/homescreens/folio/qml/delegate/WidgetDelegateConfig.qml index 51d9ccda..d2d20d86 100644 --- a/containments/homescreens/folio/qml/delegate/WidgetDelegateConfig.qml +++ b/containments/homescreens/folio/qml/delegate/WidgetDelegateConfig.qml @@ -192,7 +192,7 @@ Item { PC3.Button { id: button icon.name: 'settings-configure' - text: i18n('Options') + text: i18n("Options") display: (resizeFrame.handleContainer.width > Kirigami.Units.gridUnit * 7) ? PC3.Button.TextBesideIcon : PC3.Button.IconOnly readonly property var handleContainer: resizeFrame.handleContainer @@ -206,7 +206,7 @@ Item { id: contextMenuDialog preferredWidth: Kirigami.Units.gridUnit * 20 padding: 0 - title: i18n('Widget Options') + title: i18n("Widget Options") // workaround: remove background so that it doesn't remain if the widget is deleted (and this is de-initialized without closing) QQC2.Overlay.modal: null @@ -246,14 +246,14 @@ Item { Kirigami.Action { id: removeDelegateAction icon.name: 'edit-delete-remove' - text: i18n('Remove widget') + text: i18n("Remove widget") onTriggered: root.removeRequested() } Kirigami.Action { id: configureAppletAction icon.name: 'settings-configure' - text: i18n('Configure widget') + text: i18n("Configure widget") onTriggered: root.widget.applet.internalAction('configure').trigger(); } } diff --git a/containments/homescreens/folio/qml/private/ConfirmDeleteFolderDialogLoader.qml b/containments/homescreens/folio/qml/private/ConfirmDeleteFolderDialogLoader.qml index 689eeaf5..313669b5 100644 --- a/containments/homescreens/folio/qml/private/ConfirmDeleteFolderDialogLoader.qml +++ b/containments/homescreens/folio/qml/private/ConfirmDeleteFolderDialogLoader.qml @@ -31,8 +31,8 @@ Loader { sourceComponent: Kirigami.PromptDialog { id: menu - title: i18n('Confirm Folder Deletion') - subtitle: i18n('Are you sure you want to delete this folder?') + title: i18n("Confirm Folder Deletion") + subtitle: i18n("Are you sure you want to delete this folder?") standardButtons: Kirigami.Dialog.Yes | Kirigami.Dialog.Cancel onAccepted: root.accepted() diff --git a/containments/homescreens/folio/qml/settings/SettingsComponent.qml b/containments/homescreens/folio/qml/settings/SettingsComponent.qml index 19005859..0709057a 100644 --- a/containments/homescreens/folio/qml/settings/SettingsComponent.qml +++ b/containments/homescreens/folio/qml/settings/SettingsComponent.qml @@ -79,7 +79,7 @@ Item { QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop - text: i18n('Wallpapers') + text: i18n("Wallpapers") font.bold: true } } @@ -107,7 +107,7 @@ Item { QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop - text: i18n('Settings') + text: i18n("Settings") font.bold: true } } @@ -136,7 +136,7 @@ Item { QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop - text: i18n('Widgets') + text: i18n("Widgets") font.bold: true } } diff --git a/containments/homescreens/folio/qml/settings/SettingsWindow.qml b/containments/homescreens/folio/qml/settings/SettingsWindow.qml index 06dbfa00..8aa01e29 100644 --- a/containments/homescreens/folio/qml/settings/SettingsWindow.qml +++ b/containments/homescreens/folio/qml/settings/SettingsWindow.qml @@ -102,7 +102,7 @@ Window { anchors.centerIn: parent implicitHeight: folio.HomeScreenState.pageCellHeight implicitWidth: folio.HomeScreenState.pageCellWidth - name: i18n('Application') + name: i18n("Application") contentItem: DelegateAppIcon { height: root.folio.FolioSettings.delegateIconSize @@ -254,7 +254,7 @@ Window { FormCard.FormCard { FormCard.FormSwitchDelegate { - text: i18n('Show background') + text: i18n("Show background") checked: folio.FolioSettings.showFavouritesBarBackground onCheckedChanged: { if (checked !== folio.FolioSettings.showFavouritesBarBackground) { @@ -307,7 +307,7 @@ Window { FormCard.FormButtonDelegate { id: exportSettings - text: i18n('Export layout') + text: i18n("Export layout") icon.name: 'document-export' onClicked: exportFileDialog.open() } @@ -316,7 +316,7 @@ Window { FormCard.FormButtonDelegate { id: importSettings - text: i18n('Import layout') + text: i18n("Import layout") icon.name: 'document-import' onClicked: importFileDialog.open() } diff --git a/containments/homescreens/halcyon/qml/settings/SettingsScreen.qml b/containments/homescreens/halcyon/qml/settings/SettingsScreen.qml index 8cf5142c..b927b91f 100644 --- a/containments/homescreens/halcyon/qml/settings/SettingsScreen.qml +++ b/containments/homescreens/halcyon/qml/settings/SettingsScreen.qml @@ -68,7 +68,7 @@ Item { QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop - text: i18n('Wallpapers') + text: i18n("Wallpapers") font.bold: true } } @@ -96,7 +96,7 @@ Item { QQC2.Label { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop - text: i18n('Settings') + text: i18n("Settings") font.bold: true } } diff --git a/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml b/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml index 3ac9035b..69d4a04a 100644 --- a/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml +++ b/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml @@ -75,21 +75,21 @@ FormCard.AbstractFormDelegate { } Controls.ToolButton { icon.name: "network-connect" - text: i18n('Connect') + text: i18n("Connect") visible: ConnectionState != PlasmaNM.Enums.Activated && root.editMode display: Controls.ToolButton.IconOnly onClicked: changeState() } Controls.ToolButton { icon.name: "network-disconnect" - text: i18n('Disconnect') + text: i18n("Disconnect") visible: ConnectionState == PlasmaNM.Enums.Activated && root.editMode display: Controls.ToolButton.IconOnly onClicked: handler.deactivateConnection(ConnectionPath, DevicePath) } Controls.ToolButton { icon.name: "configure" - text: i18n('Configure') + text: i18n("Configure") visible: (Uuid != "") && root.editMode display: Controls.ToolButton.IconOnly onClicked: { @@ -98,7 +98,7 @@ FormCard.AbstractFormDelegate { } Controls.ToolButton { icon.name: "entry-delete" - text: i18n('Delete') + text: i18n("Delete") visible: (Uuid != "") && root.editMode display: Controls.ToolButton.IconOnly onClicked: handler.removeConnection(ConnectionPath) diff --git a/kcms/waydroidintegration/ui/WaydroidConfigurationForm.qml b/kcms/waydroidintegration/ui/WaydroidConfigurationForm.qml index 9571a562..45525e2b 100644 --- a/kcms/waydroidintegration/ui/WaydroidConfigurationForm.qml +++ b/kcms/waydroidintegration/ui/WaydroidConfigurationForm.qml @@ -25,7 +25,7 @@ ColumnLayout { description: AIP.WaydroidState.ipAddress trailing: PC3.Button { visible: AIP.WaydroidState.ipAddress !== "" - text: i18n('Copy') + text: i18n("Copy") icon.name: 'edit-copy-symbolic' onClicked: AIP.WaydroidState.copyToClipboard(AIP.WaydroidState.ipAddress) } @@ -62,7 +62,7 @@ ColumnLayout { title: i18nc("@title:window", "Confirm Waydroid Reset") subtitle: i18n("Are you sure you want to reset Waydroid ? This is a destructive action, and will wipe all user data.") standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel - + onAccepted: AIP.WaydroidState.resetWaydroidQml() } @@ -141,4 +141,4 @@ ColumnLayout { } } } -} \ No newline at end of file +} diff --git a/kwin/mobiletaskswitcher/package/contents/ui/main.qml b/kwin/mobiletaskswitcher/package/contents/ui/main.qml index 7015b58a..700ee471 100644 --- a/kwin/mobiletaskswitcher/package/contents/ui/main.qml +++ b/kwin/mobiletaskswitcher/package/contents/ui/main.qml @@ -20,7 +20,7 @@ SceneEffect { ShortcutHandler { name: 'Mobile Task Switcher' - text: i18n('Toggle Mobile Task Switcher') + text: i18n("Toggle Mobile Task Switcher") sequence: 'Meta+C' onActivated: taskSwitcherState.toggle() @@ -36,4 +36,4 @@ SceneEffect { taskSwitcherState.init(root); } } -} \ No newline at end of file +}