Refactor translation handling across scripts

This commit is contained in:
Jeffrey
2026-10-21 19:45:58 +02:00
parent 97f3f805ef
commit 785f134153
12 changed files with 120 additions and 851 deletions
+3 -3
View File
@@ -13,9 +13,9 @@ function Get-RebootFeatureLabels {
foreach ($paramKey in $candidateParamKeys) {
if ($script:Features.ContainsKey($paramKey) -and $script:Features[$paramKey].RequiresReboot -eq $true) {
$feature = $script:Features[$paramKey]
$isUndo = $script:UndoParams.ContainsKey($paramKey)
$displayLabel = if ($isUndo -and $feature.UndoLabel) { Get-Translation -Key $paramKey -Field 'UndoLabel' -Section 'Features' } else { Get-Translation -Key $paramKey -Field 'Label' -Section 'Features' }
$undoLabel = Get-Translation -Key $paramKey -Field 'UndoLabel' -Section 'Features'
$displayLabel = if ($isUndo -and $undoLabel -ne $paramKey) { $undoLabel } else { Get-Translation -Key $paramKey -Field 'Label' -Section 'Features' }
if (-not [string]::IsNullOrWhiteSpace([string]$displayLabel)) {
[void]$rebootFeatureLabels.Add([string]$displayLabel)
@@ -24,4 +24,4 @@ function Get-RebootFeatureLabels {
}
return $rebootFeatureLabels
}
}