Powershell: The current UI culture isn't respected - messages continue to be displayed in English

Created on 2 Oct 2019  路  5Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

  • Run on Windows.
  • Make sure that Deutsch (Deutschland) (German (Germany) is installed as a Windows UI (display) language via the Windows 10 Settings application.
[cultureinfo]::CurrentUICulture = 'de-DE'; Get-Item nosuch 2>&1 | Should -match 'nicht gefunden'

Expected behavior

The test should succeed.

Actual behavior

The test fails:

Expected regular expression 'nicht gefunden' to match Cannot find path 'C:\Users\User\nosuch' because it does not exist., but it did not match.

That is, the error message was still emitted in English.

This is a regression of sorts from Windows PowerShell, where the above test succeeds.
However, Windows PowerShell's problem is that [cultureinfo]::CurrentUICulture is reset after each command line.

Environment data

PowerShell Core 7.0.0-preview.4
Issue-Question Resolution-Answered WG-Interactive-HelpSystem

All 5 comments

I am not sure that localized help was published. Debug shows internall exception and fallback to en-US.

The test actually tests error messages, not help content.

I naively assumed that since localized DLLs are present in $PSHOME (although on Unix platforms there are only 2) that at least startup messages, error messages, ... would already be localized.

Is this being tracked somewhere? Is there a roadmap?

/cc @SteveL-MSFT? 馃檪

The localized dlls come only from .Net Core, no PowerShell dlls.
It is tracked in #666 (sorry for the number :-) )

:) Thanks, @iSazonov - I'm closing this.

Was this page helpful?
0 / 5 - 0 ratings