Refactor feature label handling to utilize language catalogs (#890)

This commit is contained in:
Jeffrey
2026-11-08 17:55:46 +01:00
committed by GitHub
parent cf691cda94
commit e6184a2597
29 changed files with 173 additions and 677 deletions
+3 -3
View File
@@ -6,7 +6,7 @@
Iterates over every non-control parameter in $script:Params and emits a
human-readable line for each change that will be applied. For the
'RemoveApps' parameter the list of targeted app names is displayed
inline. Feature labels are resolved from Features.json when available;
inline. Feature labels are resolved from the language catalogs when available;
otherwise the raw parameter name is used as a fallback.
After printing the summary the function pauses until the user presses
@@ -16,7 +16,7 @@ function Write-PendingChanges {
Write-Output "Win11Debloat will make the following changes:"
if ($script:Params['CreateRestorePoint']) {
Write-Output "- $($script:Features['CreateRestorePoint'].Label)"
Write-Output "- $(Get-Translation -Key 'CreateRestorePoint' -Field 'Label' -Section 'Features')"
}
foreach ($parameterName in $script:Params.Keys) {
if ($script:ControlParams -contains $parameterName) {
@@ -45,7 +45,7 @@ function Write-PendingChanges {
continue
}
default {
$message = $script:Features[$parameterName].Label
$message = Get-Translation -Key $parameterName -Field 'Label' -Section 'Features'
Write-Output "- $message"
continue
}