-
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
Programmatically switching from left to right/right to left localization. #14755
Comments
@rolfbjarne @jonathanpeppers What is the expectation for in-app culture changes related to system language settings on Android and iOS? |
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
@bluetreee While we get clarity on expectations here of whether the layout direction should change automatically, I suggest you try changing it by setting the LayoutDirection to RightToLeft or LeftToRight. https://learn.microsoft.com/dotnet/api/microsoft.maui.applicationmodel.layoutdirection?view=net-maui-7.0 |
It's seems like Apple's expectation for iOS is "don't do that." I haven't found anything official from Apple, but these stackoverflow posts don't seem to find a good solution for Objective-C/Swift apps:
Where the answer basically is: do it yourself, there's no automatic support for it. |
The info I found for Android basically recommends restarting the entire https://stackoverflow.com/q/13181847 This would probably still work in a .NET MAUI app, as calling |
You can set the You can get to the window from any xaml element |
Hi @bluetreee. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. |
Thanks for looking into this. We've tried setting the |
Setting the FlowDirection at page level works on elements declared directly on that page. However, elements inside of a ContentView are not displayed if the FlowDirection is set to RightToLeft. |
Greetings folks, it's been a while, is there any new updates to this ticket? |
Did this one ever get resolved in .NET 8? |
The flow direction issues in ContentView were resolved. That may be the last thing we needed to resolve to close this issue. @rachelkang and @PureWeen - do we think this is closeable, or is there more to address? |
Verified this issue with Visual Studio Enterprise 17.9.0 Preview 2.1. Can repro on android platforms with sample project. |
Description
We are trying to implement a settings page that will allow the user to select a language preference between English and Arabic. When we programmatically change the
System.Globalization.CultureInfo.CurrentCulture
andSystem.Globalization.CultureInfo.CurrentUICulture
, the text resources will translate, but the left to right/right to left orientation of the screen elements will not change. Currently, it appears the only way for the app to change from left to right/right to left is when the device language is changed.Steps to Reproduce
Result: The text has switched to English, but the right to left layout flow is still being observed.
Expected Result: The text has switched to English, and the layout flow has switched to left to right.
This also occurs if the device setting is set to English on startup and the language is switched to Arabic in the app (text changes, but left to right layout flow persists).
Link to public reproduction project repository
https://github.com/bluetreee/LocalizationTest
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
Android API 33, iOS 16
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: