Skip to content

Problem with UI Culture #35638

Closed
Closed

Description

@Robert-LTH

I think i need an explanation about why NlsGetUserDefaultUICulture uses InitializeUserDefaultCulture instead of InitializeUserDefaultUICulture. I think this is why i get the wrong result when using CurrentUICulture when my process is running as system.

Activity

  1. added
    untriaged
    on Apr 30, 2020
  2. tarekgh commented on Apr 30, 2020

    @tarekgh
    Member

    InitializeUserDefaultUICulture is calling NlsGetUserDefaultUICulture. We cannot make NlsGetUserDefaultUICulture to call InitializeUserDefaultUICulture or it will be infinite loop.

    private static CultureInfo GetUserDefaultUICulture() => GlobalizationMode.UseNls ?

    could you tell me more about your environment to investigate? we may have some bug somewhere. Are you turning Nls config switch on? otherwise, you'll be using ICU by default now which maybe the bug in this path.

    CC @safern

  3. tarekgh commented on Apr 30, 2020

    @tarekgh
    Member

    I think the bug is here

    private static CultureInfo IcuGetUserDefaultUICulture()

  4. added and removed
    untriaged
    on Apr 30, 2020
  5. added this to the 5.0 milestone on Apr 30, 2020
  6. tarekgh commented on Apr 30, 2020

    @tarekgh
    Member

    thanks @Robert-LTH for reporting this issue. we'll try to fix this soon.

  7. self-assigned this
    on Apr 30, 2020
  8. Robert-LTH commented on Apr 30, 2020

    @Robert-LTH
    Author

    Thank you for looking into this! I can add some info to this, it might help you understand my issue.

    if i run dism /online /get-intl it outputs

    Default system UI language : en-US

    Default User Locale is sv-SE.

    If i check the properties of CultureInfo.CurrentUICulture it has LCID = 1053 (sv-SE). I expect this to be 1033 (en-US).

  9. tarekgh commented on Apr 30, 2020

    @tarekgh
    Member

    @Robert-LTH thanks for the info. I assume you are using v5.0 bits here as the whole discussion around that. Just to ensure we all in the same page.

    As a workaround, if this is blocking you, you may use the config switch

    .

  10. safern commented on Apr 30, 2020

    @safern
    Member

    Thanks @Robert-LTH for reporting the issue. I've put up a PR to fix this: #35680

  11. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions