Multi-Language Apps with .NET MAUI Blazor Localization

preview_player
Показать описание
Localization is a great way to let your app reach a broader audience and be more inclusive! In this video we will learn how to add localization to your .NET MAUI Blazor app with Microsoft.Extensions.Localization. With the help of the IStringLocalizer and resx files we will see how to add translations for different languages to our app in minutes!

💝 Join this channel to get access to perks:

Disclaimer: this channel is done on personal title, in my free time, and not officially affiliated with or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.

🔗 Links

⏱ Timestamps
00:00 - Add Localization to .NET MAUI Blazor
00:22 - Why Localization?
01:27 - .NET MAUI Blazor Dialog Sample Explained
02:08 - Install Microsoft.Extensions.Localization
03:53 - Adding Localizable Resources (resx)
04:40 - Pro-Tip: ResxManager!
05:37 - Localization in Razor Files
07:34 - Add Localized Resources resx File
10:29 - Add Localization Through Code
11:37 - Localize Strings with Parameters In It
14:28 - Use AI to Implement All Your Localization

🙋‍♂️ Also find my...

#dotnetmaui #localization #blazor #dotnet #resx
Рекомендации по теме
Комментарии
Автор

Would really like to know how to dynamically switch the language. If I have a kiosk-style app and the user wants to see a different language but cannot change the device language, how can that be done?

davidsaylor
Автор

I'm a big fan of your videos! Thank you for sharing with us.

PierreBritoM
Автор

That was fantastic. But what about right to left (RTL) languages? In that case, I think there is a lot of stuff to do in the UI. Can you make a video about that?

amirh.jabari
Автор

Great, but how do I add localization to pure MAUI app (not Blazor) ? In Xamarin forms i am loading localized strings in a service and then binding them to xaml. Problem is that the service do not implement INotifyPropertyChange (seems complex, boilerplate and not performant to me), so users have to restart the app when they change language. What is the correct way here ? Maybe MVU is to recue ?

Martin-kjod
Автор

Great video, if you publish another for Blazor, I'll watch it!

robjo__
Автор

Can you teach how to change the language of components such as file type input? because I'm Brazilian and everything on my computer is in Portuguese, but "Choose File" appears instead of "Selecionar Arquivo" (in Portuguese).

vagner
Автор

Can you apply a dropdown for both English and other language conversion like in a MainLayout page.>>

if someone want to translate Arabic then select dropdown

tahirjaved
Автор

So helpful thanks Gerald, please do the one with api

ahmadsalim
Автор

Great introduction to the localizer. But instead of using the key of the resources as string I would suggest using nameof(MyStrings.HelloWorld). So you can be sure you don't misspell the key and renaming the key later is also much easier.

MeDjezze
Автор

create InputSelect<TValue> to user yourself change language

Leqsus
Автор

Awesome video. How would a user change the language within the app?

MrLazyleader
Автор

I'm watching all your content about Maui Blazot which is great for implementing my components.
Now I'm stuck with the input date which keeps using US format when my system uses fr. I'm even willing to temporaly use US format as a temporaly solution but nothing seems to do the trick.
Does anyone have a suggestion?

tofu
Автор

How to set the language from app and not use the device language

RavikumarPatra
Автор

Ahh I was so happy you started in Dutch, haha, well English it is :D

gemma
Автор

Back in the days I used to localize c++ applications using GNU gettext with .po files if I remember correctly. When calling into gettext using a key that doesn't actually exist, there was a mechanism that fell back to the key itself instead. So the default localization didn't have to reside in a specific resource file, but instead in form of keys. For example: gettext("Hello World."). Actually I liked that a lot, because it was way more readable in code than artificially thought of keys that people tend to start shorten or even use magic numbers for at the end of the day...

I didn't study the source of in detail yet, but it looks like LocalizedString does this as well, right?

Tronex
Автор

Thanks Gerald
How to add xamarin essential to MAUI Blazor like camera for example ?

cissemy
Автор

Hi
I don't know what Maui Blazor app is at the first place. I developed in Maui. I heard about blazor which is a framework to develop web apps. I don't know about Maui Blazor Apps. Can you please help with this.

townmilk
Автор

There is an easy way to localize raw content like images, audio, or serialized data (ie: json) specific to the language?
Without the need to manually interpret the current culture and locate the correct file.

IIARROWS
Автор

Great video, how can we set device language ? and is it possible to translate to other language not by changing device language but through a dropdown using Microsoft extension hosting package !

Neha-lhok
Автор

video on using desktop menubar with maui blazor?

zhh