-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApplicationLanguages.PrimaryLanguageOverride doesn't update x:Uid without restarting the app #5940
Comments
@fabiant3 FYI |
@MikeHillberg and @codendone FYI as well |
@YegorStepanov @StephenLPeters Is it really a bug? According to the documentation:
|
As far as I know, WinUI 3 is a continuation of UWP, and if something doesn't work and there are no docs that say it deprecated/can't be applied, then it is bug. Whether it's a bug or not, reloading the app to change the language is a bad UX. |
Hello all! I am starting now with WinUI 3 localization (Win10, Community Toolkit and WinUI 3 at the latest versions (as of July 2023). My .NET libraries are updating the newly set language at runtime:
My WinUI 3 Projects do not; but it is updated on App restart:
I would like you @ynborokh to give us an example of "listen to the QualifierValues property on a default resource context and take whatever actions may be needed to reload resources" And i wonder (in my humble experience) why the at-runtime-WinUI3-Language-Update could not be an async Method(), that, once finished, has done all the resource-reloading? Best, MJ:) |
Two years on and this still appears to be, assumeably, not a priority. It's possible to spin up our own version of language resource management which can be applied appropriately upon language change to the relevant UI components; but that seems like a lot of work for something which probably should be handled the same way bindeable properties are updated across the UI layout. I can't seem to find where microsoft-ui-xaml or the WinSDK resolve resw files, would be more than happy to take a look if someone can point me in the right direction. |
@duncanmacmichael i tested with v1.6-exp2 and now we can use |
Thanks, @ghost1372! Closing as fixed in 1.6.240701003-experimental2 via microsoft/WindowsAppSDK#4523. |
Describe the bug
After setting
ApplicationLanguages.PrimaryLanguageOverride
, the new pages use oldx:Uid
. Restart only refresh it. The code below updatesx:Uid
in UWP but doesn't in WinUI.The following sub-links also don't solve the problem:
UWP - Change of Languages
Are in WinUI the way to update x:Uid in runtime without manually updating strings in response to qualifier value change events?
Steps to reproduce the bug
Steps to reproduce the behavior:
Strings/en/Resources.resw
and toStrings/ru/Resources.resw
x:Uid
toTextBlock
OnLaunched
and eliminate the errors (base.Frame
is null by default in WinUI)Expected behavior
The newly created
Page
/Window
has the desired localizatedx:Uid
.Version Info
[WinUI 3 - Windows App SDK 0.8: 0.8.0]
[WinUI 3 - Windows App SDK 1.0.0-preview1]
Windows app type:
The text was updated successfully, but these errors were encountered: