Make your Xamarin.Forms app Multilingual Automagically

Make your Xamarin.Forms app Multilingual Automagically ✨😁

Hi everyone, Imagine you could translate your existing cross platform mobile application into more than 20 different languages just by a few mouse clicks and have these languages automatically displayed on the user interface depending on which language the user’s device is running on. I was looking for a means to make my Xamarin.Forms mobile app multilingual without much efforts as I just stated above, I asked google as usual and went through several blog posts, a few channel 9 videos and documentations, and found a way to do this very very easily. I came across a Visual studio extension which permits you to translate your resource files easily, this tool is not very new and also, it was not very easy to make it work and perform its magic. Now, I’ll show you how to use this tool and overcome some problems you may encounter when getting started with it. We will create a simple project and implement the multilingual feature just for demo purposes.

Let’s Add the Code necessary to handle Translations in Our App.

Here, we will create the project and make the user interface load the appropriate language resources depending on the user’s current language. You can create a demo application, or use your existing app. I created a new app for demo purposes.

#Update : I recently updated this post with a better implementation for this feature. Here is the updated portion.

We will create first a static class with extension methods for the type string this will permit us to not only translate via XAML but also in C# code.

As easy as that, and on every control, you will have the translated text appropriately. Now let me show you to install the tool to automatically translate your resource files. And how to use this tool.

Install the extension, configure it and the project properly.

Here, I’ll guide you through the steps required to make the extension work properly, you will have to go through most of these steps only once and after, you will only have to translate your strings with a few clicks. You need to install the Multilingual App Toolkit extension, and follow these steps.

Build your project and, you will have all your string resources translated to the language of your choice.

French

After all of these steps, you should be able to run your app and have the text on the label translated appropriately. You will not need to configure that much for your next translations, just with a minimal effort, you have all of your string resources translated to the languages of your choice and the correct string resource will be used on the UI automatically depending on the user’s default language.

English

If you liked this post, or it was useful to you, please 👍 like it, share it on twitter, facebook or other social media… in case you want to get updated on any new useful post, follow me on twitter and like my page on facebook.

Get started with building MVVM applications with ReactiveUI and Xamarin.Forms Here.