mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 04:42:05 -04:00
Add a new "Add by Address" flow in the printer settings that allows users to manually add printers by IP address or hostname, enabling printing to devices not visible via mDNS/Avahi discovery (e.g., printers behind Tailscale subnet routers, VPNs, or across network boundaries). Go backend: - New cups.testConnection IPC method that probes remote printers via IPP Get-Printer-Attributes with /ipp/print then / fallback - Input validation with host sanitization and protocol allowlist - Auth-aware probing (HTTP 401/403 reported as reachable) - lpadmin CLI fallback for CreatePrinter/DeletePrinter when cups-pk-helper polkit authorization fails QML frontend: - "Add by Address" toggle alongside existing device discovery - Manual entry form with host, port, protocol fields - Test Connection button with loading state and result display - Smart PPD auto-selection by probed makeModel with driverless fallback - All strings use I18n.tr() with translator context Includes 20+ unit tests covering validation, probe delegation, TLS flag propagation, auth error detection, and handler routing.
DankMaterialShell Translations
This directory contains translation files for DankMaterialShell extracted from all qsTr() calls in the QML codebase.
Files
- en.json - Source language file with English strings and file references
- template.json - Empty template for creating new translations
- extract_translations.py - Script to regenerate translation files
POEditor Format
The JSON files follow POEditor's import format:
[
{
"term": "string to translate",
"context": "file:line",
"reference": "Modules/Settings/AboutTab.qml:45",
"comment": ""
}
]
Field Descriptions
- term: The source string in English (from qsTr() calls)
- context: Primary location where the string appears (file:line)
- reference: All locations where this string is used (comma-separated)
- comment: Additional notes for translators (currently empty)
How to Create a New Translation
- Copy
template.jsonto your language code (e.g.,es.jsonfor Spanish) - Fill in the
translationfield for each entry:{ "term": "Settings", "translation": "Configuración", "context": "Modals/Settings/SettingsModal.qml:147", "reference": "Modals/Settings/SettingsModal.qml:147", "comment": "" } - Import to POEditor or use directly in your translation workflow
Regenerating Translation Files
To update the translation files after code changes:
cd /home/brandon/.config/quickshell/DankMaterialShellGit/translations
./extract_translations.py
This will scan all QML files and regenerate en.json and template.json.
Notes
- Strings are deduplicated - if the same string appears in multiple locations, references are merged
- File paths are relative to the project root
- Line numbers are preserved for accurate context
- Empty strings and comments are reserved for translator notes