Xamarin Forms Multilingual App

Dinesh Falwadiya
3 min readMar 12, 2022

Is your app’s audience comes from different kinds of regions/countries whose primary language is not just English? You must provide multilingual support to your app which can help your app/business grow.

Output

Introduction

In this article, I am going to demonstrate how to change the language of our app from English to Arabic. I am choosing the Arabic language because in the Arabic language the phrase is written & read from Right to Left.

Let’s Start

Before we begin let’s divide our implementation into the following steps

  1. Create English/Default & Arabic Language Resource Files
  2. Implement the language change code on our page.

Create English/Default & Arabic Language Resource Files

Let’s note down the language code of the languages that we are using, you can use this link.

Language Codes

Now add the resource file with extension .resx in a separate folder. Follow the below steps on the newly created folder Resx.

Right Click → Add → New Item → Resource File

Default Language

Name it as AppResource.resx , this file will hold the default text/language of the app.

Add another resource file Arabic language named AppResource.ar.resx here ar is the language code of the Arabic Language.

Arabic Language

It will look like this after adding both Default & Arabic language resource files.

Both Resources

Add texts for resource files Arabic & Default languages & make sure its access modifier is Public.

Default Language Messages
Arabic Language Messages

Let’s Code

Create a ContentPage & Add Label to display welcome text & Button to change the language.

in this code instead of setting direct hardcoded text to label & button we will use the namespace of resource file we added & use the keys to get the text.

Code-behind has the code of setting App Flow Direction, Applying new language selection & Reloading the app to see the result of language change.

Output

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Dinesh Falwadiya
Dinesh Falwadiya

Written by Dinesh Falwadiya

Mobile app developer who loves to share his knowledge and get improve with others.

No responses yet

Write a response