Closed gmgallo closed 5 months ago
Also noted that updating the sample project project from MicrosoftWindowsAppSDK version 1.3 to 1.5 crashes at startup.
Hi, @gmgallo ! I'm going to be away from my laptop, so I won't be able to help you out with this for a couple of days, but can you check the following?
Hi @AndrewKeepCoding, Thanks for the quick return!
I'll revert the changes temporarily until you have some time to look into it.
I was able to reproduce the issue by just updating to WinAppSDK v1.5. It seems that this is not related to the WinUI3Localizer but to the TemplateStudio project.
The error disappears by bringing a PublishProfiles
folder and its contents (*.pubxml files) from another working WinAppSDK v1.5. Recreating a TemplateStudio project from scratch might be a better idea.
Hi Andrew, thanks for the return, unfortunately the solution is a risky alternative for me. My project is in the final phase with almost two years of development, countless services and views. Too late to start from scratch a new TemplateStudio and migrate everything over there. I have bad experience trying to recycle parts of old project into a new one. Lots of things go on behind the scenes that can't be fixed just by renaming namespaces.
This is a nice feature for many developers around the world. I hope this makes its way as an add in option to TemplateStudio or the CommunityToolkit MVVM templates.
Closing this since it seems not to be related to WinUI3Localizer. Reopen this or create a new issue if you need my help.
I'm implementing the WinUI3 Localizer in my MVVM project duplicating the sample project available with the NuGet package. Unfortunately, SettingsViewModel.cs throws and exception when its constructor reaches the last statement because _localizationService.GetCurrentLanguage() returns an empty string;
the second problem I encountered is that the It fails to return the default language in a machine where the app runs for a first time (ie no "AppLocalizationLanguage" setting yet). This was solved by preventing that to changing the initalization logic in LocalizationService.cs from this:
To this:
Edit: Whit this change I hopped to be able to get back the localized strings with the default language, but I did not, and _localizationService.GetCurrentLanguage() still returns an empty string.
Maybe I missed to copy a piece of code somewhere?
Implementing the WinUI3Localizer is a great addition to the UX but it is not trivial. Hopefully it gets added to the CommunityToolkit.Mvvm, or, at least a detailed step by step instructions are published with the package for that framework.