In this PowerApps tutorial, we will discuss how to build multilingual apps in PowerApps. It is easy to create multilingual in PowerApps In this app, we can provide multiple language options to the user so that a user can choose it’s own language while using this app.
How to build multilingual apps in PowerApps? First, you need to create an excel file that contians the language, key and value and store it in onedrive or in SharePoint Online list. Then to use this in PowerApps, do a lookup to the excel item based on the key.
Now, let us see in details step by step how to create multilingual app in PowerApps.
Build multilingual apps in PowerApps
In the case of a SharePoint solution, we can easily handle this using a Resource file but in PowerApps we do not have any option to add a resource file. So I have gone through a few MSDN articles and I found one solution to handle resource files in Excel file.
You can also keep your resource file in a SharePoint Online list, but here I am using Microsoft Excel as a resource file where I am storing Key and value.
Step 1: Open the PowerApps -> Create a Canvas app from blank -> Create a app with Mobile or Tablet view.
Step 2: Next in your screen, Drag and drop your required control and here I am using the below design. The first step in a multilingual app is to remove the “hardcoded” strings from it. That means that all text, messages, etc. that are shown to the user need to be taken out of the app.
Step 3: As we know resource files always expect two things. One is Key and the other is Value. Create an excel file that has three columns.
- Language Name : (Lang) – Where you will store your preferred language like English, Arabic or french
- Key: Which is common for one value. It is like a key and value pair.
- Value: Where you will store your Control Title like Name, Phone Number, Company Name, etc.
Note: Make sure you are using a table in excel to storing your data because PowerApps can’t except normal excel files. So you have to keep your data inside a table in Excel.
Step 4: Next go to the PowerApps page and -> DataSource and Search Import from Excel .
Step 4: Next drag and drop one drop-down box where you will add your language name which the user will choose. So go to the Item property in Drop Down and add user’s prefer language.
Step 5: Next go to the Drop down OnChange property and add the below like code.
Set(setLanguage,Coalesce(LookUp(Table3,ddlLanguage.Selected.Value = Lang).Lang, "en"))
Here I have created a global variable setLanguage and Table3 is my table name of the excel and Lang is the first column name of my excel.
Step 6: Next go your other control and remove the direct text and add the below formula. This formula will check your Key and it will return you the value.
LookUp(Table3,Key="EmpTitle" And Lang=setLanguage,Value)
LookUp(Table3,Key="name" And Lang=setLanguage,Value)
LookUp(Table3,Key="Comp" And Lang=setLanguage,Value)
LookUp(Table3,Key="Gander" And Lang=setLanguage,Value)
LookUp(Table3,Key="buttonTitle" And Lang=setLanguage,Value)
Step 7: Next save your app and run it to see the Output. You can see I am changing my language in the drop-down and other text fields get changed by default as per language selected.
You may like the following PowerApps tutorials:
- Automatically scroll Gallery control in PowerApps
- PowerApps notify function- How to use
- Share PowerApps to external users or guest users
- Saving microphone audio recorded in PowerApps to SharePoint online
- PowerApps filter SharePoint list Example
- Display COVID-19 Power bi report in PowerApps
- How to embed Power bi report in PowerApps portal
- How to display Power bi google analytics in PowerApps
- PowerApps Chart Control – How to Use
In this example, we learned how easily we can create a multilingual apps in PowerApps. Building multilingual apps in PowerApps is really easy.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).