Problem with UI Culture

%3CLINGO-SUB%20id%3D%22lingo-sub-1343353%22%20slang%3D%22en-US%22%3EProblem%20with%20UI%20Culture%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1343353%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20my%20organisation%20we%20have%20identified%20a%20problem%20when%20trying%20to%20identify%20the%20current%20UI%20language.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20powershell%20you%20can%20use%20%24PSUICulture%20(%20from%20some%20version%20)%20or%20Get-UICulture%20to%20identify%20the%20language%20of%20the%20UI.%20This%20is%20true%20if%20it%20run%20by%20a%20user%20or%20admin%20of%20the%20computer.%20If%20the%20same%20variable%20or%20command%20is%20used%20by%20SYSTEM%20you%20get%20something%20else.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20setup%3A%3C%2FP%3E%3COL%3E%3CLI%3ERefimage%20installed%20with%20en-US%201903%20iso%2C%20installed%20languge%20pack%20sv-se%20(from%20language-iso)%3C%2FLI%3E%3CLI%3EDeployed%20using%20unattend.xml%20and%20settings%20of%3A%3COL%3E%3CLI%3E%3CINPUTLOCALE%3E041d%3A0000041d%3C%2FINPUTLOCALE%3E%3C%2FLI%3E%3CLI%3E%3CSYSTEMLOCALE%3Esv-SE%3C%2FSYSTEMLOCALE%3E%3C%2FLI%3E%3CLI%3E%3CUILANGUAGE%3Een-US%3C%2FUILANGUAGE%3E%3C%2FLI%3E%3CLI%3E%3CUSERLOCALE%3Esv-SE%3C%2FUSERLOCALE%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3CLI%3ELogged%20in%20as%20the%20user%20the%20windows%20UI%20is%20presented%20in%20english%20and%20everything%20looks%20good%3COL%3E%3CLI%3ERun%20powershell.exe%20as%20regular%20user%20and%20run%20%22Write-Host%20%24PSUICulture%22%20which%20returns%20%22en-US%22%3C%2FLI%3E%3CLI%3ERun%20powershell.exe%20as%20SYSTEM%20and%20run%26nbsp%3B%22Write-Host%20%24PSUICulture%22%20which%20returns%20%22sv-SE%22%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3Eoutput%20from%20dism%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EDeployment%20Image%20Servicing%20and%20Management%20tool%0AVersion%3A%2010.0.18362.1%0A%0AImage%20Version%3A%2010.0.18362.778%0A%0AReporting%20online%20international%20settings.%0A%0ADefault%20system%20UI%20language%20%3A%20en-US%0ASystem%20locale%20%3A%20sv-SE%0ADefault%20time%20zone%20%3A%20W.%20Europe%20Standard%20Time%0AActive%20keyboard(s)%20%3A%20041d%3A0000041d%0AKeyboard%20layered%20driver%20%3A%20Not%20installed.%0A%0AInstalled%20language(s)%3A%20en-US%0A%20%20Type%20%3A%20Fully%20localized%20language.%0AInstalled%20language(s)%3A%20sv-SE%0A%20%20Type%20%3A%20Partially%20localized%20language%2C%20MUI%20type.%0A%20%20Fallback%20Languages%20en-US%0A%0AThe%20operation%20completed%20successfully.%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIs%20there%20something%20wrong%20with%20my%20configuration%20or%20is%20the%20command%20simply%20returning%20the%20wrong%20value%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Regular Visitor

In my organisation we have identified a problem when trying to identify the current UI language.

 

In powershell you can use $PSUICulture ( from some version ) or Get-UICulture to identify the language of the UI. This is true if it run by a user or admin of the computer. If the same variable or command is used by SYSTEM you get something else.

 

This is the setup:

  1. Refimage installed with en-US 1903 iso, installed languge pack sv-se (from language-iso)
  2. Deployed using unattend.xml and settings of:
    1. <InputLocale>041d:0000041d</InputLocale>
    2. <SystemLocale>sv-SE</SystemLocale>
    3. <UILanguage>en-US</UILanguage>
    4. <UserLocale>sv-SE</UserLocale>
  3. Logged in as the user the windows UI is presented in english and everything looks good
    1. Run powershell.exe as regular user and run "Write-Host $PSUICulture" which returns "en-US"
    2. Run powershell.exe as SYSTEM and run "Write-Host $PSUICulture" which returns "sv-SE"

output from dism:

Deployment Image Servicing and Management tool
Version: 10.0.18362.1

Image Version: 10.0.18362.778

Reporting online international settings.

Default system UI language : en-US
System locale : sv-SE
Default time zone : W. Europe Standard Time
Active keyboard(s) : 041d:0000041d
Keyboard layered driver : Not installed.

Installed language(s): en-US
  Type : Fully localized language.
Installed language(s): sv-SE
  Type : Partially localized language, MUI type.
  Fallback Languages en-US

The operation completed successfully.

Is there something wrong with my configuration or is the command simply returning the wrong value?

 

0 Replies