.NET MAUI : Write multilingual apps easily
This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.If you need a solution to create multilingual applications without the hassle of implementing all kinds of code, I have good news for you. I’ve migrated my Xamarin.Forms package to .NET MAUI, and you can easily build multilingual applications with MAUI. No need to restart the application, the language takes effect immediately and works on all platforms. You can also use it from XAML, and C# code. It can handle multiple resource files at the same time. It can store the last language set by the user, and the next time you restart it, it will use the same language as the last time the user set it. But instead of letters, watch this video to see what exactly it can do: Let’s get started This project is available on GitHub: https://github.com/banditoth/MAUI.Packages To start with, I’ve put together a demo app for you for the sake of demonstration. There is no extra functionality, just 4 buttons. Three of them are to change the language of the application, and one of them is to give us a pop-up window. There is no logic to it yet, but together we will build on the article. Create translation files The first thing you will need are files containing multilingual translations. If you are familiar with Xamarin Forms, I will not surprise you: we…
Xamarin UWP: Use multilanguage resource files properly
This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.IIf you are experiencing the oddity that the UWP version of your application can’t find the correct language version of your ‘resx’ files, then you have probably fallen into the same error I did. The language management of UWP apps works differently to its Android and iOS counterparts. Reade more about it at: https://docs.microsoft.com/en-us/windows/apps/design/globalizing/manage-language-and-region How the UWP deals with multilingualism in brief Two different lists are considered as the list of languages supported by the application. One is the list of languages supported by windows (language pack installed), and the other is the list of languages supported by the application (resx files created for them). The intersection of these can only be handled by the language switching code. Where to define all of the supported languages by the app Easily, without mainting it you can define them in only one line making a change in ‘Package.appxmanifest‘ file. The x-generate value will collect all of the available languages on compile time. Otherwise, you will need to list all of them one by one: Best practice? Perhaps, if the application is running on UWP platform, you should make an if statement for the runtime platform and filter out languages that are not supported by windows.
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.