Skip to content

Fix ApplicationLanguages::PrimaryLanguageOverride() - #6421

Open
hoshiizumiya wants to merge 1 commit into
microsoft:mainfrom
hoshiizumiya:main
Open

Fix ApplicationLanguages::PrimaryLanguageOverride()#6421
hoshiizumiya wants to merge 1 commit into
microsoft:mainfrom
hoshiizumiya:main

Conversation

@hoshiizumiya

Copy link
Copy Markdown

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@ghost1372

Copy link
Copy Markdown
Contributor

@hoshiizumia
Does this fix
#6118 ?

@hoshiizumiya

Copy link
Copy Markdown
Author

Mahdi Hosseini (@ghost1372) I dont know😕. The WindowsAppSdk repo cannot be compiled currently. Related APIs are all Windows SDK encapsulations, and I don't know why it happened, which includes #6346.

@Jay-o-Way

Copy link
Copy Markdown
Contributor

What's the reason for this PR? What does it solve? I don't see any context 🤷🏻‍♂️

@hoshiizumiya hoshiizumiya changed the title Try to fix ApplicationLanguages::PrimaryLanguageOverride() Fix ApplicationLanguages::PrimaryLanguageOverride() Aug 7, 2026
@hoshiizumiya

Copy link
Copy Markdown
Author

What's the reason for this PR? What does it solve? I don't see any context 🤷🏻‍♂️

Bro, what are you talking about. The comments already included.
Fixes #6118.

For packaged applications,
Microsoft.Windows.Globalization.ApplicationLanguages
currently forwards PrimaryLanguageOverride writes to
Windows.Globalization.ApplicationLanguages, but the getter only
returns the process-local m_language value.

As a result, Windows persists the override correctly, but after
the process restarts m_language is empty and the Windows App SDK
getter incorrectly returns an empty string.

For packaged applications this change delegates the getter to
Windows.Globalization.ApplicationLanguages, matching the documented
wrapper behavior and restoring the persisted value.

Unpackaged applications continue using the process-local value,
since PrimaryLanguageOverride is intentionally not persisted for
unpackaged apps.

The setter also allows an empty string so callers can clear the
override.

@Jay-o-Way

Copy link
Copy Markdown
Contributor

hoshiizumiya

First. Don't "bro" me. You don't know me and I expect to be addressed with respect.

Second. The comment asks you "does this solve this issue?" And your answer was clearly "I don't know".

Third. It's common courtesy to link an open issue and/or add an explanation to the PR, including the problem, the solution, and telling how the solution was tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants