-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Blazor Desktop tenets: Global readiness #2532
Comments
Thanks for contacting us. |
I spent a bit of time working this out today. To start with MAUI configures the CurrentCulture / CurrentUICulture based on the device's ambient information. Closest available docs are from Xamarin.Forms, but they apply to MAUI too https://docs.microsoft.com//xamarin/xamarin-forms/app-fundamentals/localization/text?pivots=windows#test-localization. This allows Interestingly, .NET's resourcing system also supports embedding images as blobs in to the app which IStringLocalizer does not support. Even if a user were to read these images using ResourceManager, we currently don't have a component that allows rendering the retrieved Stream as an image. In addition to this, there are platform specific ways to include localized images. This problem would apply to WebViews in general, but browser elements do not know how to do the interact with these systems. That said, I couldn't get this to work with my Android sample, I'm working on following up with devs on this if this is meant to work. Dynamically changing the app culture at runtime is a bit interesting - in WASM, we expect the app to be reloaded if the culture changes. This take care of re-rendering the root component and flushing the new culture to child components. There are some instances of users trying this in their Xamarin.Forms apps which relies on triggering an event causing their app to re-render. A determined user could do something similar to re-render the root component in this case. |
@guardrex could I get some help with the docs for this? The plan is to document this as another pivot on the localization page of the Blazor docs: https://docs.microsoft.com/en-us/aspnet/core/blazor/globalization-localization?view=aspnetcore-6.0&pivots=webassembly? |
We're going to have a focused Blazor Hybrid node, so we can have a topic on this there. I've added it to the tracking issue and cross-linked this issue for work. Blazor Hybrid tracking |
Thanks. I'll close this issue since we're already tracking work in the docs issue. |
The text was updated successfully, but these errors were encountered: