Skip to content

Add persistent output locale override setting#6310

Open
Trenly wants to merge 10 commits into
microsoft:masterfrom
Trenly:trenly/fix-422-output-locale-override
Open

Add persistent output locale override setting#6310
Trenly wants to merge 10 commits into
microsoft:masterfrom
Trenly:trenly/fix-422-output-locale-override

Conversation

@Trenly

@Trenly Trenly commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

📖 Description

Add a persistent output.locale user setting that allows overriding WinGet interface language via a BCP47 tag.

This PR also ensures the override affects MRT resource resolution by setting both ApplicationLanguages::PrimaryLanguageOverride and the global Language qualifier, and updates packaging so local builds can include localized winget.resw files from Localization\Resources\<locale> when Shared\Strings\<locale> is absent.

🔗 References

Resolves #422

🔍 Validation

  • Built locally and confirmed settings are read and locale override is applied at startup.
  • No additional automated tests were run in-agent.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

* Add output.locale setting and schema support
* Apply runtime language qualifier override for resource resolution
* Include localized resw fallbacks in dev package and update docs/release notes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Trenly Trenly changed the base branch from release-v1.29 to master June 21, 2026 04:51
@microsoft-github-policy-service microsoft-github-policy-service Bot added Issue-Feature This is a feature request for the Windows Package Manager client. Area-Settings Issue related to WinGet Settings labels Jun 21, 2026
Comment thread src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj
@Trenly Trenly marked this pull request as ready for review June 21, 2026 05:10
@Trenly Trenly requested a review from a team as a code owner June 21, 2026 05:10
Comment thread src/AppInstallerCLICore/Core.cpp Outdated
Comment thread src/AppInstallerCLICore/Core.cpp Outdated
Comment thread src/AppInstallerCLICore/Core.cpp Outdated
Comment thread src/AppInstallerCommonCore/UserSettings.cpp Outdated
Comment thread src/AppInstallerCLITests/UserSettings.cpp
Comment thread doc/windows/package-manager/winget/settings.md
Comment thread src/AppInstallerCLICore/Core.cpp Outdated
@Trenly Trenly requested review from JohnMcPMS and florelis June 29, 2026 20:52
Comment thread src/AppInstallerCommonCore/Public/winget/UserSettings.h Outdated
Comment thread src/AppInstallerCLICore/Core.cpp Outdated
@microsoft-github-policy-service microsoft-github-policy-service Bot added Needs-Author-Feedback Issue needs attention from issue or PR author Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Jun 30, 2026
@Trenly Trenly requested a review from florelis July 1, 2026 13:04
florelis
florelis previously approved these changes Jul 1, 2026

@florelis florelis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'd want to hold off on merging until we have a plan for what to do with App Installer.

Comment thread src/AppInstallerCommonCore/UserSettings.cpp Outdated
@florelis

florelis commented Jul 1, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@Trenly

Trenly commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@florelis - I get the same E2E test failures from my last checkout on master

Recording.2026-07-01.224731.mp4

@Trenly Trenly requested a review from florelis July 3, 2026 03:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new persisted output.locale user setting that lets WinGet override the UI/output language (via a supported BCP47 tag), and wires the setting into startup initialization so localized resources resolve accordingly. It also updates schema/docs/release notes and adjusts packaging to pick up localized winget.resw files during local builds.

Changes:

  • Introduces Setting::OutputLocale (settings mapping + validation/normalization against supported locale tags).
  • Applies the locale override at CLI startup via ApplicationLanguages::PrimaryLanguageOverride.
  • Updates the settings schema + documentation + release notes, and adds packaging fallback to include localized winget.resw from Localization\Resources\<locale> when Shared\Strings\<locale> is absent.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/AppInstallerCommonCore/UserSettings.cpp Adds supported-locale normalization and validation for the new output.locale setting.
src/AppInstallerCommonCore/Public/winget/UserSettings.h Adds the OutputLocale setting enum value and JSON mapping to .output.locale.
src/AppInstallerCLITests/UserSettings.cpp Adds unit tests covering default/valid/case-insensitive/invalid locale values.
src/AppInstallerCLIPackage/AppInstallerCLIPackage.wapproj Adds build-time fallback PRIResource includes from Localization\\Resources\\<locale> for local builds.
src/AppInstallerCLICore/Core.cpp Applies the persisted output locale override during startup initialization.
schemas/JSON/settings/settings.schema.0.2.json Adds output.locale to the public settings schema with supported enum values.
doc/windows/package-manager/winget/settings.md Documents the new output.locale setting for end users.
doc/Settings.md Documents the new output.locale setting in the repo’s settings documentation.
doc/ReleaseNotes.md Adds a release note entry for the new output locale override feature.

Comment on lines +87 to +92
try
{
// Always apply the setting value, including empty string, to clear a persisted override from
// previous sessions. PrimaryLanguageOverride is package-scoped and persists across sessions.
winrt::Windows::Globalization::ApplicationLanguages::PrimaryLanguageOverride(Utility::ConvertToUTF16(localeTag));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this applies, as we don't use qualifiers anywhere AFAIK

@florelis

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@florelis

Copy link
Copy Markdown
Member

Looks like we will need to reset the override in App Installer. Internal PR number for that: 16173490
I won't merge this until that other change is in place.

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

Labels

Area-Settings Issue related to WinGet Settings Issue-Feature This is a feature request for the Windows Package Manager client. Needs-Attention Issue needs attention from Microsoft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the user to override winget's locale setting

4 participants