Thank you for sharing making this video and sharing it with us. this kind of video helps those business owners who have a business and want to develop mobile and web applications but have no knowledge of technology and coding and so keep sharing this kind of video.
Thank you so much for this. I will implement this in my App. I'd set the default preference to device language instead of en-US, but that shouldn't be too difficult.
Hi Gerald, as always - a great video! Is it possible, that you have a demo for a .NET MAUI App in your repository? Couldn't find anything in the web. All examples are for BLAZOR. Thank you!
Hi Gerald, great stuff thanks for sharing such a great tutorials. I am looking for a solution of offline sync functionality with .net MAUI. It would be great if you share something related to creating manual offline synchronization with Rest API and .Net MAUI using SQLite s3db. Thanks
Great video to make translation easy - thanks ! Now there's still the problem of the text format for date and decimal values that wont change The problem seems to be on the WebView2 Does any one have a solution (that doesn't require to completetly redesign components) ?
if I switch the language, I have to start the app new,only after the restart of the app it will change. Do you have a idea for this, because my plan is to change the language after click and not after restart ;)
Same for me. I think the the thread of the app is different, so when you change page, culture changes are lost. I had to restart the app for the changes to be applied.
Nice video :) although... for language selection... it is a UX guideline to show the name of the language in its own language, since people who don't read chinese for instance, won't know what language to pick from if all of them are written in chinese. The more user-friendly approach is to only write the language "chinese" in chinese, and other languages in their respective language. How would we go about that? The expectation is a list with "English, Nederlands, Francais, ..."
Is that from the great UX bible that everyone should adhere to? 😉 Good suggestion! Shouldn't be that hard, I think the CultureInfo object has a property that will always have the English name. Use that for your list and you're golden!
@@jfversluis aaah but that's the thing, I don't always want the English name either, because we can't assume that everyone knows English just the same way as we can't assume everyone knows Chinese ;) Ideally I want all languages displayed in their own native language, so speakers of that language recognise the value they need to select in the list. Dutch should in that case be represented by "Nederlands" (in every UI language), French should be represented by "Français", Finnish by "Suomi", Chinese in chinese characters, and so on. I could hard-code the list to always use these values but then the system isn't very dynamic... Does every culture info have a display value in its own language? Or how should we go about that?
I am using one xaml page that uses two blazor components that both use the localization as you described. One of the components does the actual language settings. The component that does do the language settings gets set to the new language automatically. The other component doesn't get updated. I have to restart the app for it to reflect the language changes. Any ideas how I can automatically update the other components too?
yes, because the parent component is already preloaded. In my solution I informed the user, that the langugae will be updated in the next start of the app.. but I also would like to have an better solution for this.
I have downloaded the sample repository error faced while debug ```Error CS1061 'IServiceCollection' does not contain a definition for 'AddMauiBlazorWebView' and no accessible extension method 'AddMauiBlazorWebView' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) MauiBlazorLocalizationSample (net6.0-android), MauiBlazorLocalizationSample (net6.0-ios), MauiBlazorLocalizationSample (net6.0-maccatalyst), MauiBlazorLocalizationSample (net6.0-windows10.0.19041)``` can you please help to resolve this
@@jfversluis Still the same ! I am Using Visual Studio 2022 preview 17.2.0 2.1 version does it have anything to do with the preview version ? Severity Code Description Project File Line Suppression State Error CS1061 'IServiceCollection' does not contain a definition for 'AddMauiBlazorWebView' and no accessible extension method 'AddMauiBlazorWebView' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) MauiBlazorLocalizationSample (net6.0-ios), MauiBlazorLocalizationSample (net6.0-maccatalyst), MauiBlazorLocalizationSample (net6.0-windows10.0.19041) Downloads\MauiBlazorDynamicLocalizationSample-main\MauiBlazorLocalizationSample\MauiProgram.cs 18 Active Severity Code Description Project File Line Suppression State Error CS1061 'IServiceCollection' does not contain a definition for 'AddBlazorWebViewDeveloperTools' and no accessible extension method 'AddBlazorWebViewDeveloperTools' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) MauiBlazorLocalizationSample (net6.0-android), MauiBlazorLocalizationSample (net6.0-ios), MauiBlazorLocalizationSample (net6.0-maccatalyst), MauiBlazorLocalizationSample (net6.0-windows10.0.19041) Downloads\MauiBlazorDynamicLocalizationSample-main\MauiBlazorLocalizationSample\MauiProgram.cs 20 Active
Hm I might need to update the template more. There have been breaking changes in the templates. Create a new Blazor app yourself and copy over the code bits that have to do with the language selection
Hi Gerald, i tried implementing this logic in my .net core razor pages app but it didn't work. Do you have a sample project for razor pages as well? Thanks a lot!
For regular Blazor it's a little different, check out the docs for it: docs.microsoft.com/aspnet/core/blazor/globalization-localization?view=aspnetcore-6.0&pivots=server#dynamically-set-the-culture-by-user-preference
@@jfversluis thanks so much for the reply! i am not using Blazor, i am using Razor page :) nevertheless, i had some similar work done in the past in the program.cs file with all the pipeline of adding localization, it just didn't work for some reason... i will keep researching. thanks a lot my friend!
@@jfversluis Thanks so much that would be great, I yet couldn't convince myself to use xamarin forms as I'm not happy with it's project architecture, so I'm wating for RC release of MAUI to start working on mobile.
@@cyrildouglas9262 Even though you might not be using Forms right now, you can still look up resources on how to do things and they should be easily transferable to .NET MAUI. Might be helpful when you start looking into .NET MAUI!
Curious on how to localize your .NET MAUI Blazor app in the first place? Check out this video: ruclips.net/video/EHoO9hG-Uzo/видео.html
and how about localizing a non-Blazor MAUI app?
@@andrewg.a.7661 Yes that we want to know ! :D
Look up how to do it for Xamarin.Forms, it will be the same 🤓
@@jfversluis Done and it works ! Except on Windows, I have refresh problems 😫
Thank you for sharing making this video and sharing it with us. this kind of video helps those business owners who have a business and want to develop mobile and web applications but have no knowledge of technology and coding and so keep sharing this kind of video.
Thanks for watching!
Thank you so much for this. I will implement this in my App. I'd set the default preference to device language instead of en-US, but that shouldn't be too difficult.
Just request whatever value is in those CultureInfo objects to see the device ones
Hi Gerald,
as always - a great video!
Is it possible, that you have a demo for a .NET MAUI App in your repository?
Couldn't find anything in the web. All examples are for BLAZOR. Thank you!
Hi Gerald, great stuff thanks for sharing such a great tutorials. I am looking for a solution of offline sync functionality with .net MAUI. It would be great if you share something related to creating manual offline synchronization with Rest API and .Net MAUI using SQLite s3db. Thanks
Great video to make translation easy - thanks !
Now there's still the problem of the text format for date and decimal values that wont change
The problem seems to be on the WebView2
Does any one have a solution (that doesn't require to completetly redesign components) ?
Thanks Gerald for your awesome video.
I hope you will explain how to change the direction of the app when switching the language too.
You should be able to set the RTL property for that :)
if I switch the language, I have to start the app new,only after the restart of the app it will change. Do you have a idea for this, because my plan is to change the language after click and not after restart ;)
Same for me. I think the the thread of the app is different, so when you change page, culture changes are lost. I had to restart the app for the changes to be applied.
Have you found any solution for this ?
thank you very much!
My pleasure!
Nice video :) although... for language selection... it is a UX guideline to show the name of the language in its own language, since people who don't read chinese for instance, won't know what language to pick from if all of them are written in chinese. The more user-friendly approach is to only write the language "chinese" in chinese, and other languages in their respective language. How would we go about that? The expectation is a list with "English, Nederlands, Francais, ..."
Is that from the great UX bible that everyone should adhere to? 😉 Good suggestion! Shouldn't be that hard, I think the CultureInfo object has a property that will always have the English name. Use that for your list and you're golden!
@@jfversluis aaah but that's the thing, I don't always want the English name either, because we can't assume that everyone knows English just the same way as we can't assume everyone knows Chinese ;)
Ideally I want all languages displayed in their own native language, so speakers of that language recognise the value they need to select in the list. Dutch should in that case be represented by "Nederlands" (in every UI language), French should be represented by "Français", Finnish by "Suomi", Chinese in chinese characters, and so on. I could hard-code the list to always use these values but then the system isn't very dynamic... Does every culture info have a display value in its own language? Or how should we go about that?
Use @culture.NativeName in the select list instead of Name. :)
@@johankrantz8478 that's so useful! I didn't know that property existed :D thanks a lot!
Thank you so much .🤗
My pleasure Ali!
is there a way to do this in a normal .net maui application?
Absolutely
I am using one xaml page that uses two blazor components that both use the localization as you described. One of the components does the actual language settings. The component that does do the language settings gets set to the new language automatically. The other component doesn't get updated. I have to restart the app for it to reflect the language changes. Any ideas how I can automatically update the other components too?
yes, because the parent component is already preloaded. In my solution I informed the user, that the langugae will be updated in the next start of the app.. but I also would like to have an better solution for this.
I have downloaded the sample repository error faced while debug
```Error CS1061 'IServiceCollection' does not contain a definition for 'AddMauiBlazorWebView' and no accessible extension method 'AddMauiBlazorWebView' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) MauiBlazorLocalizationSample (net6.0-android), MauiBlazorLocalizationSample (net6.0-ios), MauiBlazorLocalizationSample (net6.0-maccatalyst), MauiBlazorLocalizationSample (net6.0-windows10.0.19041)```
can you please help to resolve this
Updated! Try again please! :D
@@jfversluis Still the same ! I am Using Visual Studio 2022 preview 17.2.0 2.1 version does it have anything to do with the preview version ?
Severity Code Description Project File Line Suppression State
Error CS1061 'IServiceCollection' does not contain a definition for 'AddMauiBlazorWebView' and no accessible extension method 'AddMauiBlazorWebView' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) MauiBlazorLocalizationSample (net6.0-ios), MauiBlazorLocalizationSample (net6.0-maccatalyst), MauiBlazorLocalizationSample (net6.0-windows10.0.19041) Downloads\MauiBlazorDynamicLocalizationSample-main\MauiBlazorLocalizationSample\MauiProgram.cs 18 Active
Severity Code Description Project File Line Suppression State
Error CS1061 'IServiceCollection' does not contain a definition for 'AddBlazorWebViewDeveloperTools' and no accessible extension method 'AddBlazorWebViewDeveloperTools' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) MauiBlazorLocalizationSample (net6.0-android), MauiBlazorLocalizationSample (net6.0-ios), MauiBlazorLocalizationSample (net6.0-maccatalyst), MauiBlazorLocalizationSample (net6.0-windows10.0.19041) Downloads\MauiBlazorDynamicLocalizationSample-main\MauiBlazorLocalizationSample\MauiProgram.cs 20 Active
Hm I might need to update the template more. There have been breaking changes in the templates.
Create a new Blazor app yourself and copy over the code bits that have to do with the language selection
Can i use this technique in WPF as well?
You mean WPF with a BlazorWebView? It should!
Hi Gerald,
i tried implementing this logic in my .net core razor pages app but it didn't work.
Do you have a sample project for razor pages as well?
Thanks a lot!
For regular Blazor it's a little different, check out the docs for it: docs.microsoft.com/aspnet/core/blazor/globalization-localization?view=aspnetcore-6.0&pivots=server#dynamically-set-the-culture-by-user-preference
@@jfversluis thanks so much for the reply! i am not using Blazor, i am using Razor page :)
nevertheless, i had some similar work done in the past in the program.cs file with all the pipeline of adding localization, it just didn't work for some reason...
i will keep researching. thanks a lot my friend!
Oh sorry! Misread that 😅 don’t have much experience with that. Hope you’ll figure it out!
@@jfversluis no worries, thank a lot :)
Thanks for this great video, how about the normal MAUI App (not MAUI blazor)?
I will probably do that at some point, but it shouldn't be any different than localizing your Xamarin.Forms app :)
@@jfversluis Thanks so much that would be great, I yet couldn't convince myself to use xamarin forms as I'm not happy with it's project architecture, so I'm wating for RC release of MAUI to start working on mobile.
@@cyrildouglas9262 Even though you might not be using Forms right now, you can still look up resources on how to do things and they should be easily transferable to .NET MAUI. Might be helpful when you start looking into .NET MAUI!
@@jfversluis Of course, thank you so much for pointing these out, I check some stuff in xamarin forms as well.
what amazing you are
Well thank you! :D
awesome
Hope it's useful!