1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 14:32:52 -05:00

i18n: general term cleanup, add missing terms, interpolate some

This commit is contained in:
bbedward
2025-12-18 16:19:27 -05:00
parent baf23157fc
commit 2a91bc41f7
30 changed files with 1540 additions and 421 deletions

View File

@@ -1,8 +1,6 @@
import QtQuick
import Quickshell
import qs.Common
import qs.Services
import qs.Widgets
import qs.Modules.ControlCenter.Widgets
CompoundPill {
@@ -15,64 +13,64 @@ CompoundPill {
property var selectedMount: {
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) {
return null
return null;
}
const targetMount = DgopService.diskMounts.find(mount => mount.mount === mountPath)
return targetMount || DgopService.diskMounts.find(mount => mount.mount === "/") || DgopService.diskMounts[0]
const targetMount = DgopService.diskMounts.find(mount => mount.mount === mountPath);
return targetMount || DgopService.diskMounts.find(mount => mount.mount === "/") || DgopService.diskMounts[0];
}
property real usagePercent: {
if (!selectedMount || !selectedMount.percent) {
return 0
return 0;
}
const percentStr = selectedMount.percent.replace("%", "")
return parseFloat(percentStr) || 0
const percentStr = selectedMount.percent.replace("%", "");
return parseFloat(percentStr) || 0;
}
isActive: DgopService.dgopAvailable && selectedMount !== null
primaryText: {
if (!DgopService.dgopAvailable) {
return "Disk Usage"
return I18n.tr("Disk Usage");
}
if (!selectedMount) {
return "No disk data"
return I18n.tr("No disk data");
}
return selectedMount.mount
return selectedMount.mount;
}
secondaryText: {
if (!DgopService.dgopAvailable) {
return "dgop not available"
return I18n.tr("dgop not available");
}
if (!selectedMount) {
return "No disk data available"
return I18n.tr("No disk data available");
}
return `${selectedMount.used} / ${selectedMount.size} (${usagePercent.toFixed(0)}%)`
return `${selectedMount.used} / ${selectedMount.size} (${usagePercent.toFixed(0)}%)`;
}
iconColor: {
if (!DgopService.dgopAvailable || !selectedMount) {
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5)
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5);
}
if (usagePercent > 90) {
return Theme.error
return Theme.error;
}
if (usagePercent > 75) {
return Theme.warning
return Theme.warning;
}
return Theme.surfaceText
return Theme.surfaceText;
}
Component.onCompleted: {
DgopService.addRef(["diskmounts"])
DgopService.addRef(["diskmounts"]);
}
Component.onDestruction: {
DgopService.removeRef(["diskmounts"])
DgopService.removeRef(["diskmounts"]);
}
onToggled: {
expandClicked()
expandClicked();
}
}