Localization in .NET MAUI - Adding Multi-Language to Your Apps

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 95

  • @jfversluis
    @jfversluis  ปีที่แล้ว +1

    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

  • @Pevi70
    @Pevi70 ปีที่แล้ว +3

    Dank je wel, Gerald!
    Click
    Thanks, Gerald!

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Haha you’re welcome!

  • @tryabrain1sk
    @tryabrain1sk 2 หลายเดือนก่อน

    Thank you! Very nicely explained. I'll be grateful for more videos about Maui

  • @cavanmcsweney869
    @cavanmcsweney869 5 หลายเดือนก่อน

    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

    • @jfversluis
      @jfversluis  5 หลายเดือนก่อน

      They’re very powerful indeed! Glad it was useful!

  • @jewersp
    @jewersp ปีที่แล้ว +1

    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.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Excellent! Please let me know when you post it!

    • @jewersp
      @jewersp ปีที่แล้ว

      @@jfversluis Sure, I'll send you a message!

  • @paulwainwright1453
    @paulwainwright1453 2 หลายเดือนก่อน

    Hi Gerald, How could the below 'Incomplete' and 'Complete' strings be localized?

    Incomplete
    Complete

    Thanks :)

  •  2 หลายเดือนก่อน

    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.

  • @Programmidis
    @Programmidis 4 หลายเดือนก่อน

    Thank you so much, Gerald! I made all Shell MenuBarItem(s) and MenuFlyoutItem(s) get translated automatically. It works like a charm!

    • @jfversluis
      @jfversluis  4 หลายเดือนก่อน +1

      Well done my friend!

  • @hungchip
    @hungchip 6 หลายเดือนก่อน

    why not use MVVM?
    How should I write the last 2 methods in LocalizationResourceManager file with MVVM?

  • @bassoons9974
    @bassoons9974 ปีที่แล้ว +1

    Thanks, well build up and explained!

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Glad it was helpful!

  • @its-AliRaza
    @its-AliRaza ปีที่แล้ว

    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 ?

  • @frankpohl5620
    @frankpohl5620 ปีที่แล้ว

    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?

  • @marcmognol
    @marcmognol ปีที่แล้ว

    Hi! The way you pronounced @ 6:33 the R is perfect in French 😂😂 Bravo et merci.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      😂 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 😅

  • @pr0_secrurity876
    @pr0_secrurity876 ปีที่แล้ว

    Hello Gerald, can you make a video about inApp purchase for android/ios/windows/mac

  • @markoliberty7581
    @markoliberty7581 11 หลายเดือนก่อน

    How do you change the datetime settings of a datetime picker? Month, day names stay the same, they dont change like that.

  • @torres0945
    @torres0945 ปีที่แล้ว

    And if we have our app opened and change language from android system how we can get this event?

  • @mb72oz
    @mb72oz ปีที่แล้ว

    Thanks, Gerald, I'd definitely be interested in a follow-up video about the plugin mentioned at the end of this already-useful video.

    • @jfversluis
      @jfversluis  ปีที่แล้ว +2

      Coming! And I actually found another plugin so I might do a video about the two for comparison

    • @mohammedsadiq6953
      @mohammedsadiq6953 8 หลายเดือนก่อน

      @@jfversluis any news on this

  • @infinitezymalny
    @infinitezymalny 3 หลายเดือนก่อน

    How can I managed this with IValueConverter?

  • @mohammedalsabahii2
    @mohammedalsabahii2 ปีที่แล้ว +1

    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

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      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.

    • @mohammedalsabahii2
      @mohammedalsabahii2 ปีที่แล้ว

      @@jfversluis thank you i will

  • @ihassantariq
    @ihassantariq 8 หลายเดือนก่อน

    @Gerald is RTL is supported like arabic lanaguage in .NET MAUI everywhere I have searched and found that there are still bugs. Thanks

  • @alibourkaib3003
    @alibourkaib3003 ปีที่แล้ว +1

    Sir how to add change Language in
    new Shellcontent....
    {
    Title=AppResource.....(here)
    }

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      I’m sorry, not sure what you mean

    • @alibourkaib3003
      @alibourkaib3003 ปีที่แล้ว

      I want to change language in shell in cs

    • @yasminaamroun8682
      @yasminaamroun8682 ปีที่แล้ว

      @ALI BOURKAIB did it work with you in the Shel?

  • @pushanroychowdhury5741
    @pushanroychowdhury5741 ปีที่แล้ว

    Thanks Gerald for this. I have a request: can you please make a video on how to create a custom control with Handlers ?

  • @andrewtruckle1695
    @andrewtruckle1695 ปีที่แล้ว

    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.

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Glad it was helpful! The rest is coming soon!

  • @rameezimtiaz6274
    @rameezimtiaz6274 ปีที่แล้ว

    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. 🙂

  • @Tamer_Ali
    @Tamer_Ali ปีที่แล้ว

    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?

  • @manfredrohleder4674
    @manfredrohleder4674 ปีที่แล้ว

    Hi Gerald, how can I localize the info.plist?

  • @dsantasot
    @dsantasot 11 หลายเดือนก่อน

    How this can be done using the new .NET MAUI extension in VS Code? 🤔

    • @jfversluis
      @jfversluis  11 หลายเดือนก่อน +1

      You can’t unless there is an extension for it. Else you’ll have to do it manually

  • @Alfred545
    @Alfred545 ปีที่แล้ว

    My visual studio doesn't recognize using ProjectName.Resources.Something, but i followed all you steps.Should i have some class in Resources folder?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Make sure that you have set the access modifier to public

    • @stevehutch
      @stevehutch ปีที่แล้ว

      @@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).

  • @bashobbel3575
    @bashobbel3575 ปีที่แล้ว

    Cool , the last option is very nice

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      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 😬

  • @IvanKozlov-re9ez
    @IvanKozlov-re9ez ปีที่แล้ว

    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?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      This should help with that: blog.verslu.is/xamarin/xamarin-forms-xamarin/localization-default-ios-controls/

  • @giovanninovati7301
    @giovanninovati7301 ปีที่แล้ว +1

    Thanks, that works fine on Android, but in IOS it doesn't work at all! What's happening? What can we do?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Without any details that will be hard to say!

    • @giovanninovati7301
      @giovanninovati7301 ปีที่แล้ว

      @@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?

  • @ka4ep
    @ka4ep ปีที่แล้ว

    At last a neat and working solution instead of (Application.Current as App).MainPage = new AppShell();

  • @thomasgalliker
    @thomasgalliker 9 หลายเดือนก่อน

    Great tutorial. Sadly, Multilingual App Toolkit is not (yet) supported on .NET MAUI. Is there any progress?

    • @jfversluis
      @jfversluis  9 หลายเดือนก่อน

      I don't think so unfortunately!

    • @thomasgalliker
      @thomasgalliker 9 หลายเดือนก่อน

      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

  • @somerandominformation
    @somerandominformation ปีที่แล้ว

    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...

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      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

  • @tanakamawere
    @tanakamawere ปีที่แล้ว

    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?

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      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.

  • @JasonPurkiss
    @JasonPurkiss ปีที่แล้ว +1

    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 :)

    • @JasonPurkiss
      @JasonPurkiss ปีที่แล้ว

      worked very well

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Haha Klingon even! That's inclusiveness to the max!

  • @Jake-jk5ng
    @Jake-jk5ng 3 หลายเดือนก่อน

    Thank you so much!

    • @jfversluis
      @jfversluis  3 หลายเดือนก่อน

      You’re very welcome!

  • @CliffShivkar
    @CliffShivkar 3 หลายเดือนก่อน

    Follow up video with what Svensson has done, please!

    • @jfversluis
      @jfversluis  3 หลายเดือนก่อน +1

      You mean this one? th-cam.com/video/IBz9Ku24ZGY/w-d-xo.html

  • @Lanthiren
    @Lanthiren ปีที่แล้ว

    Could you please do a media element video for an audio media player?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      When MediaPlayer is released I will do a video on it again :)

  • @singhwong
    @singhwong ปีที่แล้ว

    Your video helped me a lot, I want to know how to localize app name in Maui.

  • @svez88
    @svez88 ปีที่แล้ว

    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 =)

  • @vitalikdm0685
    @vitalikdm0685 ปีที่แล้ว

    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

  • @KyleBeckman43
    @KyleBeckman43 ปีที่แล้ว

    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?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      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.

  • @vitaliinnest
    @vitaliinnest ปีที่แล้ว

    thx for the solution

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      You're most welcome!

  • @osamaiqbal6702
    @osamaiqbal6702 ปีที่แล้ว

    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??

  • @OscarRodriguezArdila
    @OscarRodriguezArdila ปีที่แล้ว

    Hi does this work on IOS?

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      Definitely should, yes

    • @OscarRodriguezArdila
      @OscarRodriguezArdila ปีที่แล้ว +1

      @@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?

    • @giovanninovati7301
      @giovanninovati7301 ปีที่แล้ว +1

      I have the same problem. Did you find out a solution?

  • @gwisekor
    @gwisekor ปีที่แล้ว

    goooooood

  • @jamg.barett749
    @jamg.barett749 ปีที่แล้ว

    Please make a video of google adsense on maui.

    • @jfversluis
      @jfversluis  ปีที่แล้ว

      It’s on my todo list!

  • @krishnalekkala6506
    @krishnalekkala6506 ปีที่แล้ว +1

    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 ?

    • @luigyavila7985
      @luigyavila7985 ปีที่แล้ว +1

      It's true in release mode it doesn't work, did you find any solution for this?

  • @きふわらべ
    @きふわらべ ปีที่แล้ว

    Great! Thank you. I use it.

    • @jfversluis
      @jfversluis  ปีที่แล้ว +1

      Great! Good luck!