From b2c5c71116902e18e2cf1dec4b11da86c147da82 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Thu, 9 Oct 2025 20:48:30 -0400 Subject: [PATCH] NFilePicker: added missing translations --- Assets/Translations/de.json | 6 +++++- Assets/Translations/en.json | 6 +++++- Assets/Translations/es.json | 6 +++++- Assets/Translations/fr.json | 6 +++++- Assets/Translations/pt.json | 6 +++++- Assets/Translations/zh-CN.json | 6 +++++- .../Settings/Bar/BarWidgetSettingsDialog.qml | 2 +- Widgets/NFilePicker.qml | 18 +++++++++--------- 8 files changed, 40 insertions(+), 16 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 21a946a4..79211cbb 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -801,7 +801,11 @@ }, "file-picker": { "select-folder": "Ordner auswählen", - "select-file": "Datei auswählen" + "select-file": "Datei auswählen", + "cancel": "Abbrechen", + "search-placeholder": "Dateien und Ordner suchen...", + "select-current": "Aktuelle auswählen", + "title": "Dateiauswahl" }, "datetime-tokens": { "common": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 4401d058..b2c0df34 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -785,8 +785,12 @@ "placeholder": "Placeholder" }, "file-picker": { + "title": "File Picker", "select-folder": "Select Folder", - "select-file": "Select File" + "select-file": "Select File", + "search-placeholder": "Search files and folders...", + "select-current": "Select Current", + "cancel": "Cancel" }, "datetime-tokens": { "common": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 68474d06..53a69f7a 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -784,7 +784,11 @@ }, "file-picker": { "select-folder": "Seleccionar carpeta", - "select-file": "Seleccionar archivo" + "select-file": "Seleccionar archivo", + "cancel": "Cancelar", + "search-placeholder": "Buscar archivos y carpetas...", + "select-current": "Seleccionar actual", + "title": "Selector de archivos" }, "datetime-tokens": { "common": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 478abc24..2a5b07f9 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -784,7 +784,11 @@ }, "file-picker": { "select-folder": "Sélectionner un dossier", - "select-file": "Sélectionner un fichier" + "select-file": "Sélectionner un fichier", + "cancel": "Annuler", + "search-placeholder": "Rechercher des fichiers et des dossiers...", + "select-current": "Sélectionner Actuel", + "title": "Sélecteur de fichiers" }, "datetime-tokens": { "common": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index e614733e..528ff799 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -784,7 +784,11 @@ }, "file-picker": { "select-folder": "Selecionar Pasta", - "select-file": "Selecionar Arquivo" + "select-file": "Selecionar Arquivo", + "cancel": "Cancelar", + "search-placeholder": "Pesquisar arquivos e pastas...", + "select-current": "Selecionar Atual", + "title": "Seletor de Arquivos" }, "datetime-tokens": { "common": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index d0c913a0..23af1975 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -784,7 +784,11 @@ }, "file-picker": { "select-folder": "选择文件夹", - "select-file": "选择文件" + "select-file": "选择文件", + "cancel": "取消", + "search-placeholder": "搜索文件和文件夹...", + "select-current": "选择当前", + "title": "文件选择器" }, "datetime-tokens": { "common": { diff --git a/Modules/Settings/Bar/BarWidgetSettingsDialog.qml b/Modules/Settings/Bar/BarWidgetSettingsDialog.qml index 1c2a1aaf..4eac93d3 100644 --- a/Modules/Settings/Bar/BarWidgetSettingsDialog.qml +++ b/Modules/Settings/Bar/BarWidgetSettingsDialog.qml @@ -69,7 +69,7 @@ Popup { NIconButton { icon: "close" - tooltipText: "Close" + tooltipText: I18n.tr("tooltips.close") onClicked: widgetSettings.close() } } diff --git a/Widgets/NFilePicker.qml b/Widgets/NFilePicker.qml index 2eed6c9a..4013c59c 100644 --- a/Widgets/NFilePicker.qml +++ b/Widgets/NFilePicker.qml @@ -13,7 +13,7 @@ Popup { id: root // Properties - property string title: "File Picker" + property string title: I18n.tr("widget.file-picker.title") property string initialPath: Quickshell.env("HOME") || "/home" property string selectionMode: "files" // "files" or "folders" property var nameFilters: ["*"] @@ -203,7 +203,7 @@ Popup { // "Select Current" button only visible in folder selection mode NButton { - text: "Select Current" + text: I18n.tr("widgets.file-picker.select-current") icon: "filepicker-folder-current" visible: root.selectionMode === "folders" onClicked: { @@ -214,7 +214,7 @@ Popup { NIconButton { icon: "filepicker-refresh" - tooltipText: "Refresh" + tooltipText: I18n.tr("tooltips.refresh") onClicked: { // Force a proper refresh by resetting the folder const currentFolder = folderModel.folder @@ -225,7 +225,7 @@ Popup { } NIconButton { icon: "filepicker-close" - tooltipText: "Close" + tooltipText: I18n.tr("tooltips.close") onClicked: { root.cancelled() root.close() @@ -256,7 +256,7 @@ Popup { NIconButton { icon: "filepicker-arrow-up" - tooltipText: "Up" + tooltipText: I18n.tr("tooltips.up") baseSize: Style.baseWidgetSize * 0.8 enabled: folderModel.folder.toString() !== "file:///" onClicked: { @@ -268,7 +268,7 @@ Popup { NIconButton { icon: "filepicker-home" - tooltipText: "Home" + tooltipText: I18n.tr("tooltips.home") baseSize: Style.baseWidgetSize * 0.8 onClicked: { const homePath = Quickshell.env("HOME") || "/home" @@ -361,7 +361,7 @@ Popup { } NTextInput { id: searchInput - placeholderText: "Search files and folders..." + placeholderText: I18n.tr("widget.file-picker.search-placeholder") Layout.fillWidth: true text: filePickerPanel.searchText onTextChanged: { @@ -378,7 +378,7 @@ Popup { } NIconButton { icon: "filepicker-x" - tooltipText: "Clear" + tooltipText: I18n.tr("tooltips.clear") baseSize: Style.baseWidgetSize * 0.6 visible: filePickerPanel.searchText.length > 0 onClicked: { @@ -814,7 +814,7 @@ Popup { } NButton { - text: "Cancel" + text: I18n.tr("widgets.file-picker.cancel") outlined: true onClicked: { root.cancelled()