1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-14 09:42:10 -04:00

Added plural support (#1750)

* Update it.json

* Enhance SettingsSliderRow: add resetText property and update reset button styling

* added i18n strings

* adjust reset button width to be dynamic based on content size

* added i18n strings

* Update template.json

* reverted changes

* Update it.json

* Update template.json

* Update NotificationSettings.qml

* added plurar support

* Update it.json

* Update ThemeColorsTab.qml
This commit is contained in:
Youseffo13
2026-02-26 15:36:42 +01:00
committed by GitHub
parent b4e7c4a4cd
commit 5d09acca4c
10 changed files with 136 additions and 45 deletions

View File

@@ -225,7 +225,13 @@ Item {
} }
StyledText { StyledText {
text: root.errorCount > 0 ? I18n.tr("%1 issue(s) found", "greeter doctor page error count").arg(root.errorCount) : I18n.tr("All checks passed", "greeter doctor page success") text: {
if (root.errorCount === 0)
return I18n.tr("All checks passed", "greeter doctor page success");
return root.errorCount === 1
? I18n.tr("%1 issue found", "greeter doctor page error count").arg(root.errorCount)
: I18n.tr("%1 issues found", "greeter doctor page error count").arg(root.errorCount);
}
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
color: root.errorCount > 0 ? Theme.error : Theme.surfaceVariantText color: root.errorCount > 0 ? Theme.error : Theme.surfaceVariantText
} }

View File

@@ -34,51 +34,51 @@ Rectangle {
readonly property var timeoutOptions: [ readonly property var timeoutOptions: [
{ {
"text": "Never", "text": I18n.tr("Never"),
"value": 0 "value": 0
}, },
{ {
"text": "1 second", "text": I18n.tr("1 second"),
"value": 1000 "value": 1000
}, },
{ {
"text": "3 seconds", "text": I18n.tr("3 seconds"),
"value": 3000 "value": 3000
}, },
{ {
"text": "5 seconds", "text": I18n.tr("5 seconds"),
"value": 5000 "value": 5000
}, },
{ {
"text": "8 seconds", "text": I18n.tr("8 seconds"),
"value": 8000 "value": 8000
}, },
{ {
"text": "10 seconds", "text": I18n.tr("10 seconds"),
"value": 10000 "value": 10000
}, },
{ {
"text": "15 seconds", "text": I18n.tr("15 seconds"),
"value": 15000 "value": 15000
}, },
{ {
"text": "30 seconds", "text": I18n.tr("30 seconds"),
"value": 30000 "value": 30000
}, },
{ {
"text": "1 minute", "text": I18n.tr("1 minute"),
"value": 60000 "value": 60000
}, },
{ {
"text": "2 minutes", "text": I18n.tr("2 minutes"),
"value": 120000 "value": 120000
}, },
{ {
"text": "5 minutes", "text": I18n.tr("5 minutes"),
"value": 300000 "value": 300000
}, },
{ {
"text": "10 minutes", "text": I18n.tr("10 minutes"),
"value": 600000 "value": 600000
} }
] ]

View File

@@ -305,7 +305,9 @@ Item {
const prefs = cfg?.screenPreferences || ["all"]; const prefs = cfg?.screenPreferences || ["all"];
if (prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all")) if (prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all"))
return I18n.tr("All displays"); return I18n.tr("All displays");
return I18n.tr("%1 display(s)").replace("%1", prefs.length); return prefs.length === 1
? I18n.tr("%1 display").arg(prefs.length)
: I18n.tr("%1 displays").arg(prefs.length);
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText

View File

@@ -344,7 +344,11 @@ Item {
return I18n.tr("%1 exists but is not included in config. Custom keybinds will not work until this is fixed.").arg(bindsFile); return I18n.tr("%1 exists but is not included in config. Custom keybinds will not work until this is fixed.").arg(bindsFile);
if (warningBox.showWarning) { if (warningBox.showWarning) {
const count = warningBox.status.overriddenBy; const count = warningBox.status.overriddenBy;
return I18n.tr("%1 DMS bind(s) may be overridden by config binds that come after the include.").arg(count); return I18n.ntr(
"%1 DMS bind may be overridden by config binds that come after the include.",
"%1 DMS binds may be overridden by config binds that come after the include.",
count
).arg(count);
} }
return ""; return "";
} }

View File

@@ -1170,7 +1170,7 @@ Item {
spacing: 2 spacing: 2
StyledText { StyledText {
text: modelData.name || "Unknown App" text: modelData.name || I18n.tr("Unknown App")
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium font.weight: Font.Medium
color: Theme.surfaceText color: Theme.surfaceText
@@ -1179,7 +1179,7 @@ Item {
StyledText { StyledText {
text: { text: {
if (!modelData.lastUsed) if (!modelData.lastUsed)
return "Never used"; return I18n.tr("Never used");
var date = new Date(modelData.lastUsed); var date = new Date(modelData.lastUsed);
var now = new Date(); var now = new Date();
var diffMs = now - date; var diffMs = now - date;
@@ -1189,11 +1189,17 @@ Item {
if (diffMins < 1) if (diffMins < 1)
return I18n.tr("Last launched just now"); return I18n.tr("Last launched just now");
if (diffMins < 60) if (diffMins < 60)
return I18n.tr("Last launched %1 minute%2 ago").arg(diffMins).arg(diffMins === 1 ? "" : "s"); return diffMins === 1
? I18n.tr("Last launched %1 minute ago").arg(diffMins)
: I18n.tr("Last launched %1 minutes ago").arg(diffMins);
if (diffHours < 24) if (diffHours < 24)
return I18n.tr("Last launched %1 hour%2 ago").arg(diffHours).arg(diffHours === 1 ? "" : "s"); return diffHours === 1
? I18n.tr("Last launched %1 hour ago").arg(diffHours)
: I18n.tr("Last launched %1 hours ago").arg(diffHours);
if (diffDays < 7) if (diffDays < 7)
return I18n.tr("Last launched %1 day%2 ago").arg(diffDays).arg(diffDays === 1 ? "" : "s"); return diffDays === 1
? I18n.tr("Last launched %1 day ago").arg(diffDays)
: I18n.tr("Last launched %1 days ago").arg(diffDays);
return I18n.tr("Last launched %1").arg(date.toLocaleDateString()); return I18n.tr("Last launched %1").arg(date.toLocaleDateString());
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall

View File

@@ -340,7 +340,9 @@ Item {
if (devices.length === 0) if (devices.length === 0)
return I18n.tr("No adapters"); return I18n.tr("No adapters");
if (connected === 0) if (connected === 0)
return I18n.tr("%1 adapter(s), none connected").arg(devices.length); return devices.length === 1
? I18n.tr("%1 adapter, none connected").arg(devices.length)
: I18n.tr("%1 adapters, none connected").arg(devices.length);
return I18n.tr("%1 connected").arg(connected); return I18n.tr("%1 connected").arg(connected);
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall

View File

@@ -548,7 +548,7 @@ Item {
const count = CupsService.printerNames.length; const count = CupsService.printerNames.length;
if (count === 0) if (count === 0)
return I18n.tr("No printers configured"); return I18n.tr("No printers configured");
return I18n.tr("%1 printer(s)").arg(count); return I18n.ntr("%1 printer", "%1 printers", count).arg(count);
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
@@ -698,7 +698,7 @@ Item {
} }
StyledText { StyledText {
text: I18n.tr("%1 job(s)").arg(printerData?.jobs?.length ?? 0) text: I18n.ntr("%1 job", "%1 jobs", printerData?.jobs?.length ?? 0).arg(printerData?.jobs?.length ?? 0)
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
visible: (printerData?.jobs?.length ?? 0) > 0 visible: (printerData?.jobs?.length ?? 0) > 0
@@ -1245,7 +1245,7 @@ Item {
} }
StyledText { StyledText {
text: I18n.tr("%1 class(es)").arg(CupsService.printerClasses.length) text: I18n.ntr("%1 class", "%1 classes", CupsService.printerClasses.length).arg(CupsService.printerClasses.length)
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
width: parent.width width: parent.width
@@ -1310,7 +1310,7 @@ Item {
} }
StyledText { StyledText {
text: I18n.tr("%1 printer(s)").arg(modelData.members?.length ?? 0) text: I18n.ntr("%1 printer", "%1 printers", modelData.members?.length ?? 0).arg(modelData.members?.length ?? 0)
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
} }

View File

@@ -1908,6 +1908,7 @@ Item {
tags: ["modal", "darken", "background", "overlay"] tags: ["modal", "darken", "background", "overlay"]
title: I18n.tr("Modal Background") title: I18n.tr("Modal Background")
settingKey: "modalBackground" settingKey: "modalBackground"
iconName: "layers"
SettingsToggleRow { SettingsToggleRow {
tab: "theme" tab: "theme"
@@ -1925,7 +1926,7 @@ Item {
tags: ["applications", "portal", "dark", "terminal"] tags: ["applications", "portal", "dark", "terminal"]
title: I18n.tr("Applications") title: I18n.tr("Applications")
settingKey: "applications" settingKey: "applications"
iconName: "terminal" iconName: "apps"
SettingsToggleRow { SettingsToggleRow {
tab: "theme" tab: "theme"
@@ -2452,6 +2453,7 @@ Item {
tags: ["icon", "theme", "system"] tags: ["icon", "theme", "system"]
title: I18n.tr("Icon Theme") title: I18n.tr("Icon Theme")
settingKey: "iconTheme" settingKey: "iconTheme"
iconName: "interests"
SettingsDropdownRow { SettingsDropdownRow {
tab: "theme" tab: "theme"
@@ -2478,7 +2480,7 @@ Item {
tags: ["system", "app", "theming", "gtk", "qt"] tags: ["system", "app", "theming", "gtk", "qt"]
title: I18n.tr("System App Theming") title: I18n.tr("System App Theming")
settingKey: "systemAppTheming" settingKey: "systemAppTheming"
iconName: "extension" iconName: "brush"
visible: Theme.matugenAvailable visible: Theme.matugenAvailable
Row { Row {

View File

@@ -2,17 +2,26 @@
"%1 Animation Speed": { "%1 Animation Speed": {
"%1 Animation Speed": "Velocità Animazione %1" "%1 Animation Speed": "Velocità Animazione %1"
}, },
"%1 DMS bind(s) may be overridden by config binds that come after the include.": { "%1 DMS bind may be overridden by config binds that come after the include.": {
"%1 DMS bind(s) may be overridden by config binds that come after the include.": "%1 associazione/i tasti di DMS potrebbe/ero essere sovrascritta/e da scorciatoie di config successive all'inclusione." "%1 DMS bind may be overridden by config binds that come after the include.": "%1 associazione tasti di DMS potrebbe essere sovrascritta da scorciatoie di config successive all'inclusione."
}, },
"%1 adapter(s), none connected": { "%1 DMS binds may be overridden by config binds that come after the include.": {
"%1 adapter(s), none connected": "%1 adattatore/i, nessuno connesso" "%1 DMS binds may be overridden by config binds that come after the include.": "%1 associazioni tasti di DMS potrebbero essere sovrascritte da scorciatoie di config successive all'inclusione."
},
"%1 adapter, none connected": {
"%1 adapter, none connected": "%1 adattatore, nessuno connesso"
},
"%1 adapters, none connected": {
"%1 adapters, none connected": "%1 adattatori, nessuno connesso"
}, },
"%1 characters": { "%1 characters": {
"%1 characters": "%1 caratteri" "%1 characters": "%1 caratteri"
}, },
"%1 class(es)": { "%1 class": {
"%1 class(es)": "%1 classe/i" "%1 class": "%1 classe"
},
"%1 classes": {
"%1 classes": "%1 classi"
}, },
"%1 connected": { "%1 connected": {
"%1 connected": "%1 connesso" "%1 connected": "%1 connesso"
@@ -29,8 +38,11 @@
"%1 disconnected (hidden)": { "%1 disconnected (hidden)": {
"%1 disconnected (hidden)": "%1 disconnesso (nascosto)" "%1 disconnected (hidden)": "%1 disconnesso (nascosto)"
}, },
"%1 display(s)": { "%1 display": {
"%1 display(s)": "%1 schermo/i" "%1 display": "%1 schermo"
},
"%1 displays": {
"%1 displays": "%1 schermi"
}, },
"%1 exists but is not included in config. Custom keybinds will not work until this is fixed.": { "%1 exists but is not included in config. Custom keybinds will not work until this is fixed.": {
"%1 exists but is not included in config. Custom keybinds will not work until this is fixed.": "%1 esiste ma non è incluso nella configurazione. Le scorciatoie personalizzate non funzioneranno finché non sarà risolto." "%1 exists but is not included in config. Custom keybinds will not work until this is fixed.": "%1 esiste ma non è incluso nella configurazione. Le scorciatoie personalizzate non funzioneranno finché non sarà risolto."
@@ -41,14 +53,20 @@
"%1 is now included in config": { "%1 is now included in config": {
"%1 is now included in config": "%1 è ora incluso nella configurazione" "%1 is now included in config": "%1 è ora incluso nella configurazione"
}, },
"%1 job(s)": { "%1 job": {
"%1 job(s)": "%1 stampa/e" "%1 job": "%1 stampa"
},
"%1 jobs": {
"%1 jobs": "%1 stampe"
}, },
"%1 notifications": { "%1 notifications": {
"%1 notifications": "%1 notifiche" "%1 notifications": "%1 notifiche"
}, },
"%1 printer(s)": { "%1 printer": {
"%1 printer(s)": "%1 stampante/i" "%1 printer": "%1 stampante"
},
"%1 printers": {
"%1 printers": "%1 stampanti"
}, },
"%1 variants": { "%1 variants": {
"%1 variants": "%1 varianti" "%1 variants": "%1 varianti"
@@ -2779,14 +2797,23 @@
"Last launched %1": { "Last launched %1": {
"Last launched %1": "Ultimo avvio %1" "Last launched %1": "Ultimo avvio %1"
}, },
"Last launched %1 day%2 ago": { "Last launched %1 day ago": {
"Last launched %1 day%2 ago": "Ultimo avvio %1 giorno/i fa" "Last launched %1 day ago": "Ultimo avvio %1 giorno fa"
}, },
"Last launched %1 hour%2 ago": { "Last launched %1 days ago": {
"Last launched %1 hour%2 ago": "Ultimo avvio %1 ora/e fa" "Last launched %1 days ago": "Ultimo avvio %1 giorni fa"
}, },
"Last launched %1 minute%2 ago": { "Last launched %1 hour ago": {
"Last launched %1 minute%2 ago": "Ultimo avvio %1 minuto/i fa" "Last launched %1 hour ago": "Ultimo avvio %1 ora fa"
},
"Last launched %1 hours ago": {
"Last launched %1 hours ago": "Ultimo avvio %1 ore fa"
},
"Last launched %1 minute ago": {
"Last launched %1 minute ago": "Ultimo avvio %1 minuto fa"
},
"Last launched %1 minutes ago": {
"Last launched %1 minutes ago": "Ultimo avvio %1 minuti fa"
}, },
"Last launched just now": { "Last launched just now": {
"Last launched just now": "Appena avviato" "Last launched just now": "Appena avviato"

View File

@@ -14656,5 +14656,47 @@
"context": "Keyboard hints when enter-to-paste is enabled", "context": "Keyboard hints when enter-to-paste is enabled",
"reference": "", "reference": "",
"comment": "" "comment": ""
},
{
"term": "What's New",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Read Full Release Notes",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Read Full Release Notes",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Got It",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "Caps Lock is on",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{
"term": "↑/↓: Nav • Space: Expand • Enter: Action/Expand • E: Text",
"translation": "",
"context": "",
"reference": "",
"comment": ""
} }
] ]