diff --git a/kcmkwin/kwinrules/Messages.sh b/kcmkwin/kwinrules/Messages.sh --- a/kcmkwin/kwinrules/Messages.sh +++ b/kcmkwin/kwinrules/Messages.sh @@ -1,4 +1,2 @@ #! /usr/bin/env bash -$EXTRACTRC *.ui >> rc.cpp || exit 11 -$XGETTEXT *.cpp *.h -o $podir/kcmkwinrules.pot -rm -f rc.cpp +$XGETTEXT `find . -name \*.cpp -o -name \*.h -o -name \*.qml` -o $podir/kcmkwinrules.pot diff --git a/kcmkwin/kwinrules/kcmrules.cpp b/kcmkwin/kwinrules/kcmrules.cpp --- a/kcmkwin/kwinrules/kcmrules.cpp +++ b/kcmkwin/kwinrules/kcmrules.cpp @@ -38,7 +38,7 @@ , m_ruleBookModel(new RuleBookModel(this)) , m_rulesModel(new RulesModel(this)) { - auto about = new KAboutData(QStringLiteral("kcm_kwinrules"), + auto about = new KAboutData(QStringLiteral("kcmkwinrules"), i18n("Window Rules"), QStringLiteral("1.0"), QString(), diff --git a/kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml b/kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml --- a/kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml +++ b/kcmkwin/kwinrules/package/contents/ui/FileDialogLoader.qml @@ -25,7 +25,7 @@ id: root active: false - property string title : i18n("Select File"); + property string title : i18nd("kcmkwinrules", "Select File"); property string lastFolder : "" property bool isSaveDialog : false @@ -37,7 +37,7 @@ title: root.title selectExisting: !root.isSaveDialog folder: (root.lastFolder == "") ? shortcuts.home : root.lastFolder - nameFilters: [ i18n("KWin Rules (*.kwinrule)") ] + nameFilters: [ i18nd("kcmkwinrules", "KWin Rules (*.kwinrule)") ] defaultSuffix: "*.kwinrule" Component.onCompleted: { diff --git a/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml b/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml --- a/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml +++ b/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml @@ -43,12 +43,12 @@ var selectionCount = selectionMask.toString(2).replace(/0/g, '').length; switch (selectionCount) { case 0: - return i18n("None selected"); + return i18nd("kcmkwinrules", "None selected"); case 1: var selectedValue = selectionMask.toString(2).length - 1; return model.textOfValue(selectedValue); case count: - return i18n("All selected"); + return i18nd("kcmkwinrules", "All selected"); } return i18np("%1 selected", "%1 selected", selectionCount); } diff --git a/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml b/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml --- a/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml +++ b/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml @@ -55,7 +55,7 @@ bottom: parent.bottom } helpfulAction: QQC2.Action { - text: i18n("Add Properties...") + text: i18nd("kcmkwinrules", "Add Properties...") icon.name: "list-add-symbolic" onTriggered: { propertySheet.open(); @@ -74,7 +74,7 @@ footer: RowLayout { QQC2.Button { - text: checked ? i18n("Close") : i18n("Add Properties...") + text: checked ? i18nd("kcmkwinrules", "Close") : i18nd("kcmkwinrules", "Add Properties...") icon.name: checked ? "dialog-close" : "list-add-symbolic" checkable: true checked: propertySheet.sheetOpen @@ -87,7 +87,7 @@ Layout.fillWidth: true } QQC2.Button { - text: i18n("Detect Window Properties") + text: i18nd("kcmkwinrules", "Detect Window Properties") icon.name: "edit-find" onClicked: { overlayModel.onlySuggestions = true; @@ -100,7 +100,7 @@ from: 0 to: 30 textFromValue: (value, locale) => { - return (value == 0) ? i18n("Instantly") + return (value == 0) ? i18nd("kcmkwinrules", "Instantly") : i18np("After %1 second", "After %1 seconds", value) } } @@ -120,7 +120,7 @@ parent: view header: Kirigami.Heading { - text: i18n("Select properties") + text: i18nd("kcmkwinrules", "Select properties") } footer: Kirigami.SearchField { id: searchField @@ -213,9 +213,9 @@ } switch (type) { case RuleItem.Boolean: - return value ? i18n("Yes") : i18n("No"); + return value ? i18nd("kcmkwinrules", "Yes") : i18nd("kcmkwinrules", "No"); case RuleItem.Percentage: - return i18n("%1 %", value); + return i18nd("kcmkwinrules", "%1 %", value); case RuleItem.Coordinate: var point = value.split(','); return i18nc("Coordinates (x, y)", "(%1, %2)", point[0], point[1]); diff --git a/kcmkwin/kwinrules/package/contents/ui/RulesList.qml b/kcmkwin/kwinrules/package/contents/ui/RulesList.qml --- a/kcmkwin/kwinrules/package/contents/ui/RulesList.qml +++ b/kcmkwin/kwinrules/package/contents/ui/RulesList.qml @@ -69,19 +69,19 @@ Kirigami.PlaceholderMessage { visible: ruleBookView.count == 0 anchors.fill: parent - text: i18n("No rules for specific windows are currently set"); + text: i18nd("kcmkwinrules", "No rules for specific windows are currently set"); } } header: Kirigami.InlineMessage { id: exportInfo icon.source: "document-export" showCloseButton: true - text: i18n("Select the rules to export") + text: i18nd("kcmkwinrules", "Select the rules to export") actions: [ Kirigami.Action { iconName: "document-save" - text: i18n("Save Rules") + text: i18nd("kcmkwinrules", "Save Rules") // FIXME: It does not update on selection changes // enabled: selectedIndexes.length > 0 onTriggered: { @@ -93,7 +93,7 @@ footer: RowLayout { QQC2.Button { - text: i18n("Add New...") + text: i18nd("kcmkwinrules", "Add New...") icon.name: "list-add-symbolic" enabled: !exportInfo.visible onClicked: { @@ -104,15 +104,15 @@ Layout.fillWidth: true } QQC2.Button { - text: i18n("Import...") + text: i18nd("kcmkwinrules", "Import...") icon.name: "document-import" enabled: !exportInfo.visible onClicked: { importDialog.active = true; } } QQC2.Button { - text: i18n("Export...") + text: i18nd("kcmkwinrules", "Export...") icon.name: "document-export" enabled: ruleBookView.count > 0 checkable: true @@ -185,15 +185,15 @@ actions: [ Kirigami.Action { - text: i18n("Edit") + text: i18nd("kcmkwinrules", "Edit") iconName: "edit-entry" onTriggered: { kcm.editRule(index); } } , Kirigami.Action { - text: i18n("Delete") + text: i18nd("kcmkwinrules", "Delete") iconName: "entry-delete" onTriggered: { kcm.removeRule(index); @@ -221,7 +221,7 @@ FileDialogLoader { id: importDialog - title: i18n("Import Rules") + title: i18nd("kcmkwinrules", "Import Rules") isSaveDialog: false onLastFolderChanged: { exportDialog.lastFolder = lastFolder; @@ -233,7 +233,7 @@ FileDialogLoader { id: exportDialog - title: i18n("Export Rules") + title: i18nd("kcmkwinrules", "Export Rules") isSaveDialog: true onLastFolderChanged: { importDialog.lastFolder = lastFolder; diff --git a/kcmkwin/kwinrules/package/contents/ui/ValueEditor.qml b/kcmkwin/kwinrules/package/contents/ui/ValueEditor.qml --- a/kcmkwin/kwinrules/package/contents/ui/ValueEditor.qml +++ b/kcmkwin/kwinrules/package/contents/ui/ValueEditor.qml @@ -63,13 +63,13 @@ Layout.fillWidth: true } QQC2.RadioButton { - text: i18n("Yes") + text: i18nd("kcmkwinrules", "Yes") checked: ruleValue Layout.margins: Kirigami.Units.smallSpacing onToggled: valueEditor.valueEdited(checked) } QQC2.RadioButton { - text: i18n("No") + text: i18nd("kcmkwinrules", "No") checked: !ruleValue Layout.margins: Kirigami.Units.smallSpacing onToggled: valueEditor.valueEdited(!checked) @@ -136,14 +136,14 @@ onMoved: valueEditor.valueEdited(Math.round(slider.value)) } QQC2.Label { - text: i18n("%1 %", Math.round(slider.value)) + text: i18nd("kcmkwinrules", "%1 %", Math.round(slider.value)) horizontalAlignment: Qt.AlignRight Layout.minimumWidth: maxPercentage.width + Kirigami.Units.smallSpacing Layout.margins: Kirigami.Units.smallSpacing } TextMetrics { id: maxPercentage - text: i18n("%1 %", 100) + text: i18nd("kcmkwinrules", "%1 %", 100) } } }