mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-25 23:16:15 +01:00
Add support links for Ukraine in Russian language (#910)
This commit is contained in:
@@ -329,6 +329,21 @@ Describe 'ConvertTo-LocalizedXaml' {
|
||||
ConvertTo-LocalizedXaml -Xaml $xaml -Lang $script:EnLang | Should -Be '<a Text="Options"/><b Text="Close"/>'
|
||||
}
|
||||
|
||||
It 'preserves translated paragraphs through XML attribute parsing with <LineEnding> line breaks' -ForEach @(
|
||||
@{ LineEnding = 'LF'; Separator = "`n" }
|
||||
@{ LineEnding = 'CRLF'; Separator = "`r`n" }
|
||||
) {
|
||||
$text = "First & second.${Separator}${Separator}Support Ukraine."
|
||||
$lang = [PSCustomObject]@{ Chrome = [PSCustomObject]@{ Message = $text } }
|
||||
$xaml = ConvertTo-LocalizedXaml -Xaml '<TextBlock Text="%LANG:Message%"/>' -Lang $lang
|
||||
$reader = [System.Xml.XmlReader]::Create([System.IO.StringReader]::new($xaml))
|
||||
try {
|
||||
[void]$reader.Read()
|
||||
$reader.GetAttribute('Text') | Should -BeExactly $text
|
||||
}
|
||||
finally { $reader.Close() }
|
||||
}
|
||||
|
||||
It 'throws when a marker key does not exist in any language' {
|
||||
$xaml = '<Button Content="%LANG:NoSuchKeyAnywhere%"/>'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user