Whoops! Look like I made a little mistake in editing... 🫣 Can you spot where? Looking for localization on your .NET MAUI Blazor app? I've got you covered, as always: th-cam.com/video/EHoO9hG-Uzo/w-d-xo.html
Great video Gerald, the last part about writing an XAML markup extensions is brilliant. Will save me so much time moving forward when having to write apps with multiple languages
I learned something again today. The markup extension approach is very neat, Gerald. Thank you for this. I might pick this up in one of my blog posts in the future.
Thanks, everything working fine. I have a question that is this possible that we have list of languages in MVVM and we have added the translation in resource file against keys and list bind to collection view. Can we get the translation of that keys through bindings ?
This is nice for the strings that are used in the program. How can the DisplayName for the app be localized? In UWP it was possible to define a reference with ms-resource:. For example putting ms-resource:AppTitle in the field "Display name" in the manifest would use the strings defined as AppTitle in the resources. But I could not get that working in .NET MAUI. Can you point me in the right direction?
😂 I almost never mix up Dutch with English! But decided to just let this one in. Glad I also speak French now! That reminds me, my French teacher would always say that my French tone was perfect but she couldn't understand a thing 😅
Awesome video we are waiting this video ,, actually there's a question some languages need to change also loading lable text from left to right or right to left so using this tool can i change FlowDirection as runtime from mvvm ?! ,, thank you for this helping video wish you a good day
Ah that's a great question! I guess you'd also have to save some information about if it's a RTL language and switch that property for your app accordingly.
Thanks for this interesting tutorial. I know that I asked for something about localization. I am also interested in the follow up video you referred too concerning the plugin for resource management.
Very useful video Gerald..! I I'd love if you make a video on "Connection with Google Drive API, upload/ download files to G Drive in .NET MAUI", as I search a lot and can't find any helpful resource. Would be super thankful to you. 🙂
Hi Gerald, Thanks for the awesome video I think Community Toolkit has a localization package I used it long time ago with Xamarin Forms. How to change the direction of the app?
@@jfversluis Hi Gerald, I am having this problem too, Visual Studio for Mac does not show the graphical editor, and also the ProjectName.Resources.Languages is not recognised and gives compilation error every time? The ViewModel, Model, Views folder are all recognised, but for some strange reason I cannot reference the Resources folder from a XAML page. I have set the build properties of the Resource.resx file as follows : Build action "embedded resource" copy to output directory : "do not copy", Custom Tool : PublicResXFileCodeGenerator, Custom To Namespace (left empty).
@@jfversluis I created a new project and followed your tutorial step by step. I did exactly what you did. It compiles on both platforms. On android it works as expected, but on IOS the language does not change, even after i restart the app. Should i add a link to the project?
You can temporarily enable a separate library with Multilingual App Toolkit, e.g. a netstandard2.0 class library. Later, when MAT supports MAUI projects, we can move the translations back to the MAUI project.Just as proposed here: github.com/microsoft/Multilingual-App-Toolkit/issues/10 @@jfversluis
Do you know how to translate an application dynamically by using Azure Translator or something? Because defining everything yourself in a separate file is not really scalable...
On windows use the Resxmanager plugin which has cloud powered translations. Doing it manually might not be great but it’s still the only way to be sure that your translations will be the best they can in each language. It just an intensive process unfortunately
Hie Gerald, unrelated to the video. It's a thought I recently had. I connected my app to the app centre and whenever the app crashed, it sent reports to Github. This was an Android .NET MAUI app. So the errors were in 'Android language' like "Java. something is null". How do I convert such platform specific errors to .NET MAUI specific errors?
Depending on what it is exactly you can't really. Some stuff just happens on the underlaying layer. It will take some experience to start recognizing those errors.
I think I went a bit nuts when I found out you could do this a few years ago as I think adding 40 languages was a bit much and stopped when trying to add Star Trek Klingon :) if you want to test for me just search for DigitalShop :)
Halo from Indonesia. Gerald , thanks for the share good information, i want to know more about ResXManager and the AI, please introduce us how to implement that , God bless =)
For those who has a VS compilation error . Change resource file property Build Action from Android Resource (that is set my default after creation in my case), just change it to Embedded Resource
I really like this approach, but the only downside I can see is the lack of intellicense as you're typing in the name of the resource to ensure proper spelling. Any idea if there's a way to get the list of options to show up as you're typing your XAML?
It depends on which method you're using. The first method definitely should show IntelliSense although it wasn't working in the video. The method with the extensions will indeed not have IntelliSense support unfortunately.
public object this[string resourceKey] => AppResources.ResourceManager.GetObject(resourceKey, AppResources.Culture) ?? Array.Empty(); this is not working when i tried it from .xaml file Any Solution??
th-cam.com/video/YHEdPg1vUr0/w-d-xo.html Hi, thank you so much for the video. Please note that this solution for me seems to be problematic if you compile in release mode. It seems to fail and you only see Microsoft.Maui.Controls.Binding for all the strings. (for me, only in release mode). Do you have guidance on that? Hi @gerald any idea on this issue ?
Whoops! Look like I made a little mistake in editing... 🫣 Can you spot where?
Looking for localization on your .NET MAUI Blazor app? I've got you covered, as always: th-cam.com/video/EHoO9hG-Uzo/w-d-xo.html
Dank je wel, Gerald!
Click
Thanks, Gerald!
Haha you’re welcome!
Thank you! Very nicely explained. I'll be grateful for more videos about Maui
Great video Gerald, the last part about writing an XAML markup extensions is brilliant. Will save me so much time moving forward when having to write apps with multiple languages
They’re very powerful indeed! Glad it was useful!
I learned something again today. The markup extension approach is very neat, Gerald. Thank you for this. I might pick this up in one of my blog posts in the future.
Excellent! Please let me know when you post it!
@@jfversluis Sure, I'll send you a message!
Hi Gerald, How could the below 'Incomplete' and 'Complete' strings be localized?
Incomplete
Complete
Thanks :)
How to use it in code-behind(C#)? Fór example I neee it for validations and display alerts, but I cant figure it out.
Thank you so much, Gerald! I made all Shell MenuBarItem(s) and MenuFlyoutItem(s) get translated automatically. It works like a charm!
Well done my friend!
why not use MVVM?
How should I write the last 2 methods in LocalizationResourceManager file with MVVM?
Thanks, well build up and explained!
Glad it was helpful!
Thanks, everything working fine. I have a question that is this possible that we have list of languages in MVVM and we have added the translation in resource file against keys and list bind to collection view. Can we get the translation of that keys through bindings ?
This is nice for the strings that are used in the program. How can the DisplayName for the app be localized? In UWP it was possible to define a reference with ms-resource:. For example putting ms-resource:AppTitle in the field "Display name" in the manifest would use the strings defined as AppTitle in the resources. But I could not get that working in .NET MAUI. Can you point me in the right direction?
Hi! The way you pronounced @ 6:33 the R is perfect in French 😂😂 Bravo et merci.
😂 I almost never mix up Dutch with English! But decided to just let this one in. Glad I also speak French now!
That reminds me, my French teacher would always say that my French tone was perfect but she couldn't understand a thing 😅
Hello Gerald, can you make a video about inApp purchase for android/ios/windows/mac
How do you change the datetime settings of a datetime picker? Month, day names stay the same, they dont change like that.
And if we have our app opened and change language from android system how we can get this event?
Thanks, Gerald, I'd definitely be interested in a follow-up video about the plugin mentioned at the end of this already-useful video.
Coming! And I actually found another plugin so I might do a video about the two for comparison
@@jfversluis any news on this
How can I managed this with IValueConverter?
Awesome video we are waiting this video ,, actually there's a question some languages need to change also loading lable text from left to right or right to left so using this tool can i change FlowDirection as runtime from mvvm ?! ,, thank you for this helping video wish you a good day
Ah that's a great question! I guess you'd also have to save some information about if it's a RTL language and switch that property for your app accordingly.
@@jfversluis thank you i will
@Gerald is RTL is supported like arabic lanaguage in .NET MAUI everywhere I have searched and found that there are still bugs. Thanks
Sir how to add change Language in
new Shellcontent....
{
Title=AppResource.....(here)
}
I’m sorry, not sure what you mean
I want to change language in shell in cs
@ALI BOURKAIB did it work with you in the Shel?
Thanks Gerald for this. I have a request: can you please make a video on how to create a custom control with Handlers ?
Thanks for this interesting tutorial. I know that I asked for something about localization. I am also interested in the follow up video you referred too concerning the plugin for resource management.
Glad it was helpful! The rest is coming soon!
Very useful video Gerald..! I I'd love if you make a video on "Connection with Google Drive API, upload/ download files to G Drive in .NET MAUI", as I search a lot and can't find any helpful resource. Would be super thankful to you. 🙂
Hi Gerald,
Thanks for the awesome video
I think Community Toolkit has a localization package I used it long time ago with Xamarin Forms.
How to change the direction of the app?
Hi Gerald, how can I localize the info.plist?
How this can be done using the new .NET MAUI extension in VS Code? 🤔
You can’t unless there is an extension for it. Else you’ll have to do it manually
My visual studio doesn't recognize using ProjectName.Resources.Something, but i followed all you steps.Should i have some class in Resources folder?
Make sure that you have set the access modifier to public
@@jfversluis Hi Gerald, I am having this problem too, Visual Studio for Mac does not show the graphical editor, and also the ProjectName.Resources.Languages is not recognised and gives compilation error every time? The ViewModel, Model, Views folder are all recognised, but for some strange reason I cannot reference the Resources folder from a XAML page. I have set the build properties of the Resource.resx file as follows : Build action "embedded resource" copy to output directory : "do not copy", Custom Tool : PublicResXFileCodeGenerator, Custom To Namespace (left empty).
Cool , the last option is very nice
Yep that makes it nice and easy! And even better with the plug-in I mentioned because you don’t even need to do the work 😬
Hi Gerald! Thanks for your video! I have a question. Can we localize MAUI controls like Picker. What if I want to change language for "Cancel" button?
This should help with that: blog.verslu.is/xamarin/xamarin-forms-xamarin/localization-default-ios-controls/
Thanks, that works fine on Android, but in IOS it doesn't work at all! What's happening? What can we do?
Without any details that will be hard to say!
@@jfversluis I created a new project and followed your tutorial step by step. I did exactly what you did. It compiles on both platforms. On android it works as expected, but on IOS the language does not change, even after i restart the app. Should i add a link to the project?
At last a neat and working solution instead of (Application.Current as App).MainPage = new AppShell();
Great tutorial. Sadly, Multilingual App Toolkit is not (yet) supported on .NET MAUI. Is there any progress?
I don't think so unfortunately!
You can temporarily enable a separate library with Multilingual App Toolkit, e.g. a netstandard2.0 class library. Later, when MAT supports MAUI projects, we can move the translations back to the MAUI project.Just as proposed here: github.com/microsoft/Multilingual-App-Toolkit/issues/10
@@jfversluis
Do you know how to translate an application dynamically by using Azure Translator or something? Because defining everything yourself in a separate file is not really scalable...
On windows use the Resxmanager plugin which has cloud powered translations. Doing it manually might not be great but it’s still the only way to be sure that your translations will be the best they can in each language. It just an intensive process unfortunately
Hie Gerald, unrelated to the video. It's a thought I recently had. I connected my app to the app centre and whenever the app crashed, it sent reports to Github. This was an Android .NET MAUI app. So the errors were in 'Android language' like "Java. something is null". How do I convert such platform specific errors to .NET MAUI specific errors?
Depending on what it is exactly you can't really. Some stuff just happens on the underlaying layer. It will take some experience to start recognizing those errors.
I think I went a bit nuts when I found out you could do this a few years ago as I think adding 40 languages was a bit much and stopped when trying to add Star Trek Klingon :) if you want to test for me just search for DigitalShop :)
worked very well
Haha Klingon even! That's inclusiveness to the max!
Thank you so much!
You’re very welcome!
Follow up video with what Svensson has done, please!
You mean this one? th-cam.com/video/IBz9Ku24ZGY/w-d-xo.html
Could you please do a media element video for an audio media player?
When MediaPlayer is released I will do a video on it again :)
Your video helped me a lot, I want to know how to localize app name in Maui.
Halo from Indonesia. Gerald , thanks for the share good information, i want to know more about ResXManager and the AI, please introduce us how to implement that , God bless =)
For those who has a VS compilation error . Change resource file property Build Action from Android Resource (that is set my default after creation in my case), just change it to Embedded Resource
I really like this approach, but the only downside I can see is the lack of intellicense as you're typing in the name of the resource to ensure proper spelling. Any idea if there's a way to get the list of options to show up as you're typing your XAML?
It depends on which method you're using. The first method definitely should show IntelliSense although it wasn't working in the video. The method with the extensions will indeed not have IntelliSense support unfortunately.
thx for the solution
You're most welcome!
public object this[string resourceKey] => AppResources.ResourceManager.GetObject(resourceKey, AppResources.Culture) ?? Array.Empty();
this is not working when i tried it from .xaml file
Any Solution??
Hi does this work on IOS?
Definitely should, yes
@@jfversluis I tried and it doesn't change the language when clicking the button in your project. Could it be something with permissions of the app?
I have the same problem. Did you find out a solution?
goooooood
Thanks!
Please make a video of google adsense on maui.
It’s on my todo list!
th-cam.com/video/YHEdPg1vUr0/w-d-xo.html
Hi, thank you so much for the video. Please note that this solution for me seems to be problematic if you compile in release mode. It seems to fail and you only see Microsoft.Maui.Controls.Binding for all the strings. (for me, only in release mode). Do you have guidance on that?
Hi @gerald any idea on this issue ?
It's true in release mode it doesn't work, did you find any solution for this?
Great! Thank you. I use it.
Great! Good luck!