Repository navigation
refactor(globalization)!: Remove UseLegacyPrimaryLanguageOverride (BC50) - #23905
Conversation
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23905/wasm-skia-net9/index.html |
|
The build 224734 found UI Test snapshots differences: Details
|
|
|
971aa1c to
c1de3f8
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23905/wasm-skia-net9/index.html |
|
The build 224861 found UI Test snapshots differences: Details
|
|
|
c1de3f8 to
e1f97c5
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23905/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23905/docs/index.html |
|
The build 225493 found UI Test snapshots differences: Details
|
|
|
WinRTFeatureConfiguration.ApplicationLanguages.UseLegacyPrimaryLanguageOverride gated a Uno-only extra ApplyCulture() call inside the PrimaryLanguageOverride setter, so setting the override swapped CultureInfo.CurrentCulture mid-session. WinUI applies the override to the culture only on the next app start. Hard-remove it (no [Obsolete] shim) and behave as if it were false: - ApplicationLanguages: drop the gated ApplyCulture() from the setter. The override is still persisted and still updates Languages immediately, and Application's constructor still applies the culture at startup, so the behaviour is WinUI's restart-to-apply. - WinRTFeatureConfiguration: delete the now-empty ApplicationLanguages holder. - PackageDiffIgnore (6.6): ignore the removed holder plus the flag property and its get/set accessors. - Given_ApplicationLanguages: fails-before/passes-after guard asserting the culture is untouched while Languages[0] follows the override. - migrating-to-uno-7.md: migration note. The flag defaulted to true, so unlike the other removed flags this changes behaviour for apps that never touched it; the note gives them the explicit CultureInfo assignment to use instead. Resource lookup (x:Uid, ResourceLoader) reads PrimaryLanguageOverride directly, so localized strings keep updating without a restart. BC50 of the 7.0 breaking-changes rollup (#8339), for #13704. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The runtime language-switch guide sets PrimaryLanguageOverride and relies on re-navigation to refresh localized strings, which still works. Call out that the culture itself now follows on the next app start (BC50), and give the explicit CultureInfo assignment for apps that need formatting to switch in-session. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Given_BitmapSource.When_MsAppData hangs indefinitely on the Linux FrameBuffer runtime-test host under .NET 11 Preview 6 (9 occurrences, never on 10.0.105; the X11 stage runs the same binary and stays green). The test awaits an ImageOpened TCS with no ImageFailed handler and no [Timeout], and UnitTestsControl only times out an async body when [Timeout] is present, so the stall consumes the entire 60-minute CI job and no results file is published. Exclude it via RuntimeTestPlatforms.SkiaFrameBuffer, which resolves from the host assembly name at runtime — both Linux stages run the same SamplesApp.Skia.Generic binary and differ only by xvfb, so a compile-time condition could not tell them apart. When_MsAppData_StreamDisposed_ FileNotLocked exercises the same ms-appdata load and is the next test to run, so it is excluded too. For #23967. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
e1f97c5 to
92cad57
Compare
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23905/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23905/wasm-skia-net9/index.html |
|
The build 225816 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
GitHub Issue: closes #13704
PR Type:
💬 Other... Breaking change (behaviour alignment with WinUI)
What changed? 🚀
Hard-removes the Uno-only
WinRTFeatureConfiguration.ApplicationLanguages.UseLegacyPrimaryLanguageOverrideflag and, with it, the legacy immediate-culture-apply path (BC50 of the Phase 5 breaking-changes wave).Before: the flag defaulted to
true, so settingWindows.Globalization.ApplicationLanguages.PrimaryLanguageOverrideswappedCultureInfo.CurrentCulture/CurrentUICulture/DefaultThreadCurrent*from inside the setter — a mid-session culture change with no WinUI counterpart.After: the setter no longer touches the culture. The override is still persisted to local settings and still updates
ApplicationLanguages.Languagesimmediately, andApplication's constructor still callsApplyCulture()at startup — so the net behaviour is WinUI's restart-to-apply.Resource lookup is unaffected:
ResourceLoaderreadsPrimaryLanguageOverridedirectly (via the separate, unchangedWinRTFeatureConfiguration.ResourceLoader.UsePrimaryLanguageOverride), sox:Uid/GetStringkeep following the new value immediately. Localized strings still hot-swap on page reload; only the formatting culture waits for the restart.ApplicationLanguages.PrimaryLanguageOverride— dropped the flag-gatedApplyCulture()call.WinRTFeatureConfiguration— deleted the flag and the now-emptyApplicationLanguagesholder (no[Obsolete]shim, per the recorded decision).PackageDiffIgnore.xml— 4 entries under<IgnoreSet baseVersion="6.6">: the removed holder type, the property form, and theget_/set_accessors. (The6.5set is retired — an in-file comment notes its entries were relocated to6.6when the diff base advanced to 6.6.166, sincegeneratepkgdiffconsults only the set matching the base major.minor.)migrating-to-uno-7.md, plus a note in the "change app language at runtime" guide, which documents exactly this scenario.Validation
Given_ApplicationLanguages.When_PrimaryLanguageOverride_Then_Culture_Unchanged— failed before the source change (CurrentCulturebecamefr-CA, expecteden-US) and passes after. It picks its target language relative to the ambient culture so it cannot pass by coincidence, and restores all fourCultureInfostatics in afinally.Given_ApplicationLanguages3/3,Given_ResourceLoader18/18 (confirms resource resolution still follows the override immediately),Given_DatePicker12/12.Uno.UWP(Skia net10.0) full rebuild withUnoFastDevBuild=false— analyzers on, 0 warnings / 0 errors.SamplesApp.Skia.Genericclean.src/Uno.UWP/reverted and rebuilt:When_Calendar13 failures inUno.UI.UnitTests(3997 pass),DatePickerIntegrationTests2 failures.PR Checklist ✅
Given_ApplicationLanguages.When_PrimaryLanguageOverride_Then_Culture_Unchanged, fails-before / passes-after.migrating-to-uno-7.mdand inguides/hotswap-app-language.md.Screenshots Compare Test Runresults — N/A (no visual change).Breaking change — impact & migration path
Unlike most flag removals in this wave, this flag defaulted to
true, so it changes behaviour for apps that never touched it.Impact (behavioural + source-breaking): apps that switched UI language at runtime by setting
PrimaryLanguageOverrideand relied onCultureInfo.CurrentCulturefollowing immediately lose that side effect — number, date, and currency formatting (and .NET resource lookup throughCurrentUICulture) keep the previous culture until the next app start. Code that read or set the flag no longer compiles, and there is no opt-back-in: the legacy path is gone.Migration: set the culture explicitly alongside the override:
Apps that already restart — or re-navigate — on language change need no change: localized strings still update through
ResourceLoader.