mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-26 07:26:18 +01:00
Refactor feature label handling to utilize language catalogs (#890)
This commit is contained in:
@@ -323,7 +323,7 @@ function Get-Translation {
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Looks up a translated label for one value of a UiGroup, falling back to en-US, then to the raw label.
|
||||
Looks up a translated label for one value of a UiGroup, falling back to en-US, then to the feature ID.
|
||||
|
||||
.DESCRIPTION
|
||||
UiGroups[GroupId].Values in the language files is a FeatureId -> Label map, one level deeper
|
||||
@@ -336,13 +336,11 @@ function Get-GroupValueTranslation {
|
||||
[string]$GroupId,
|
||||
[Parameter(Mandatory)]
|
||||
[string]$FeatureId,
|
||||
[Parameter(Mandatory)]
|
||||
[string]$FallbackLabel,
|
||||
[object]$Lang = $script:Lang
|
||||
)
|
||||
|
||||
if (-not $Lang) {
|
||||
return $FallbackLabel
|
||||
return $FeatureId
|
||||
}
|
||||
|
||||
foreach ($candidateLang in (Get-LanguageFallbackChain -Lang $Lang)) {
|
||||
@@ -357,7 +355,7 @@ function Get-GroupValueTranslation {
|
||||
}
|
||||
}
|
||||
|
||||
return $FallbackLabel
|
||||
return $FeatureId
|
||||
}
|
||||
|
||||
<#
|
||||
|
||||
Reference in New Issue
Block a user