-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Using from the Android settings dialog #32
Comments
Yes, in all scenarios the After some quick testing, I came up with this solution that works, regardless where in the app this is triggered: using System.Globalization;
namespace LocalizationResourceManager.Maui.Sample
{
public partial class App : Application
{
private readonly ILocalizationResourceManager resourceManager;
public App(ILocalizationResourceManager resourceManager)
{
InitializeComponent();
this.resourceManager = resourceManager;
MainPage = new AppShell();
}
protected override Window CreateWindow(IActivationState? activationState)
{
#if ANDROID
resourceManager.CurrentCulture = CultureInfo.GetCultureInfo(Java.Util.Locale.Default.Language);
#endif
return base.CreateWindow(activationState);
}
}
} Maybe a more elegant solution would be to have a Note: That the If you find any better solution for this or anything that could be part of the library, I would love your feedback! Finally I wanted to thank you for trying out my library and it was nice seeing you at the |
I'll play around with this some more, thanks for that! I'm happy to try it, it's a great library 👍 Nice seeing you indeed! 👌 |
Thanks! ❤️ If you haven't already, you can look at the latest prerelease version on NuGet that includes some really neat features, if I say so myself. 😄 After this, I will now include the option to change |
I wanted to use the NuGet to implement translations, so far so good. However, I didn't want to roll my own select language dialog so for Android I added a
xml/locales_config.xml
file:Then I linked that in my manifest:
I have a button that pops open the settings dialog with
AppInfo.ShowSettingsUI()
. When selecting a different language there and going back into the app it stays on the old language. A full app reboot DOES change the language. Is there something I'm missing or something built into the NuGet that would be able to handle this scenario?The text was updated successfully, but these errors were encountered: