While working with Power Apps, we can usually build or operate the applications using the English language. But you can also use a multilingual app that provides a great experience for users to work with different languages.
In this Power Apps article, I will explain Power Apps Coalesce, how to build a Power Apps multi language app in Power Apps Canvas app.
Apart from that, we will discuss about PowerApps language function and 4 different ways to make PowerApps multi language applications. Such as:
- PowerApps coalesce
- Power Apps coding language
- PowerApps language translation using Excel sheet
- Power Apps Language function
Power Apps Multilanguage
When you work with Power Apps Multilingual, the first thing that comes to mind is what this Multilingual means.
Multilingual means many or several languages. Similarly, Power Apps Multilingual defines many languages that Power Apps localizes. Like our systems (suppose Computer or mobile) support different types of languages, PowerApps also has some multi-languages.
For example, if we set any browser (Chrome) language to Spanish, we will see the authoring Studio only in that language.
1. Power Apps Coalesce
To build a Power Apps coalesce, refer to the example below.
In Power Apps, there is one Text input and a Label control. When a user enters any text in the text box (in English), that text will convert to Danish, and the result will appear in the label, as shown below.
To work around this, follow the below steps:
- In your Power Apps app, connect the MicrosoftTranslator connector, as shown below.
2. On the Power Apps Screen, insert a Text input control and set its Default property to blank.
3. Next, insert a Text label and set its Text property to the code below:
Text = MicrosoftTranslator.Translate(
txt_Record.Text,
"da" //You can add different language codes
)
Where,
- txt_Record = Power Apps text input control name
4. Once your app is ready, Save, Publish, and Preview the app. Whenever the user adds any language text to the text input, the text label translates that text into the Danish language, as shown below.
2. Power Apps Coding Language
In Power Apps, there is a Text label having some text, and a Dropdown control contains different language codes. Whenever the user selects any language code from the dropdown, the label text will be changed to the selected dropdown language.
Have a look at the below screenshot for the output:
To achieve this example, follow the below steps. Such as:
1. Select the App object [From left navigation] in the app and set its OnStart property to the code below.
OnStart = ClearCollect(
colMultilanguages,
{
Language: "English",
Code: "en"
},
{
Language: "French",
Code: "fr"
},
{
Language: "Spanish",
Code: "es"
},
{
Language: "German",
Code: "de"
},
{
Language: "Chinese",
Code: "zh"
},
{
Language: "Rusian",
Code: "ru"
}
)
Where,
- colMultilanguages = Power Apps collection name
2. On the Power Apps Screen -> Insert a Dropdown control and set its Items property as:
Items = colMultilanguages
3. Now, select Text label control and set its Text property to the code below.
Text = MicrosoftTranslator.Translate("Explore the full potential of Microsoft Power Platform products through various online training courses, documentation, and videos.
These resources provide in-depth coverage of product capabilities and practical how-to guides.
By leveraging these resources, you can learn how to build custom applications efficiently with Power Apps, automate workflows to enhance business productivity with Power Automate, analyze data for insights using Power BI, and seamlessly design, configure, and publish modern websites with Power Pages",drp_Languages.Selected.Code)
Where,
- drp_Languages = Power Apps dropdown control name
4. Save, Publish, and Preview the app. When the user selects any language code from the dropdown, the label text will be changed to the selected dropdown language, as shown below.
3. PowerApps Language Translation Using Excel Sheet
In Power Apps, there is a dropdown control containing some language codes from Excel and some text fields. If the user selects a language from the dropdown control, the text fields change based on that language.
Output:
To work around this example, follow the below steps.
- First, Create an Excel spreadsheet that should contain the Language, Key, and Value columns.
- After creating these columns, store this Excel spreadsheet in OneDrive or a SharePoint Online List.
- Use a Lookup to the Excel item based on the key in the Power Apps app.
Create an Excel Spreadsheet and Format as Table
- Create an Excel file that contains three columns: Language, Key, and Value. Where,
- Language: This column specifies different types of languages, such as English, Arabic, Spanish, French, and Dutch.
- Key: This is like a key-value pair that is common for one value. Here, you will store all the keys, such as ProdTitle, ProdName, ProdVendor, etc.
- Value: In this column, you can store your control value, such as Product Title, Product Name, Product Vendor, etc.
- Add some records to the Excel file. Select all the file contents and then format them as Tables (Select records -> Go to Home tab -> Format as Table -> Select one table).
- Enter the Excel file Table Name (Select the Excel Table, go to the Design tab, and Enter the name [PowerappsLanguages] under the Table Name field).
Below, you can see the Excel spreadsheet [Multilanguages] that I have created:
Always remember one thing: In the PowerApps Multilingue, the resource files expect only two things: a Key and a Value.
NOTE:
1. Not only you can use Microsoft Excel as a Resource file, But also you can use the SharePoint Online List where you can store the Key and Value to build a Power Apps Multilingue app.
2. You need to make sure that your records should be present inside a Table in Excel. Otherwise, Power Apps will not allow the normal Excel file.
Store the Excel Spreadsheet in OneDrive
Next, you need to upload this Excel spreadsheet [Multilanguages] in your OneDrive as shown below:
Create Power Apps Multilingual app and Use Lookup to Excel item
Now, We will create a Power Apps Multilingual app on the Power Apps screen and use the Lookup function for Excel items. For that, follow the below steps:
1. Open the Power Apps app -> Connect the respective Excel sheet [Data-> OneDrive for Business -> Excel Sheet].
2. Insert five Labels [One is for Title, and the other four are for different fields like Product Name, Product Vendor, Product Quantity, and Product Price].
3. Add four Text input controls for four Labels. Then, set all inputs Default property to blank. Insert one Button. The total app will look like the below structure:
4. Now, add a Dropdown control and set its Items property to the code below.
Items = ["Select Language","en","es","fr","de"]
5. Next, select the Dropdown control and apply the below formula on its OnChange property as:
OnChange = Set(setLang,Coalesce(LookUp(PowerappsLanguages,Dropdown1.Selected.Value = Language).Language, "en"))
Where,
- setLang = Created a Global Variable named as setLang
- Coalesce = Coalesce is a Power Apps function that helps to convert an empty string to blank values
- LookUp = LookUp function helps to find the first record in the Excel table that satisfies the formula
- PowerappsLanguages = It is the Table name of the Excel Spreadsheet
- Language = It is the First column name of the Excel sheet
6. Next, go to the other Label controls and apply these below formulae on its Text property as:
Product Details (Text) = LookUp(PowerappsLanguages,Key="ProdTitle" And Language=setLang,Value)
Product Name (Text) = LookUp(PowerappsLanguages,Key="ProdName" And Language=setLang,Value)
Product Vendor (Text) = LookUp(PowerappsLanguages,Key="ProdVendor" And Language=setLang,Value)
Product Quantity (Text) = LookUp(PowerappsLanguages,Key="ProdQuantity" And Language=setLang,Value)
Product Price (Text) = LookUp(PowerappsLanguages,Key="ProdPrice" And Language=setLang,Value)
Submit (Text) = LookUp(PowerappsLanguages,Key="BtnTitle" And Language=setLang,Value)
Where,
- PowerappsLanguages = Excel sheet Table name
- Key, Language and Value = These are the columns that are present in the Excel sheet
- setLang = Global variable name that has been created in Dropdown’s OnChange
7. Also, you can use the formula below to check your Key and its value from a specific Excel sheet.
Text = LookUP(PowerappsLanguages, Key="ProdTitle" And Language=setLang,Value)
8. As with the Title (Product Details), You will set the Text property of all the rest of the Label controls (Product Name, Product Vendor, Product Quantity, etc.).
9. Once your app is ready, Save, Publish, and Preview the app. Select any language from the Dropdown control. Then at the same time, you can see the other text fields are getting changed as per the selected language.
Have a look at the below screenshot for the output:
4. Power Apps Language Function
The Power Apps Language function returns the language and script tag of the current user. This function provides the user with languages across locales. Users can choose any language and use the app in PowerApps.
The syntax of Power Apps Language Function is “Language().” There are three formats present in the Language tag, such as:
Return Value | Description |
“lg‑RE” | lg is the two-character abbreviation for the language, and RE is the two-character abbreviation for the region. This is the most common return type. For example, “en-GB” is returned for Great Britain |
“lg” | lg is the two-character abbreviation for the language. This is the format used when Power Apps has information about the language but does not have information for the specific region |
“lg‑scrp‑RE” | lg is the two-character abbreviation for the language, scrp is the four-character abbreviation for the script, and RE is the two-character abbreviation for the region |
Example: In the Power Apps Welcome Screen has a Text label, and I want to display a greeting message [Welcome to Power Apps] in the text label based on the user’s browser language.
To do so, follow the below steps.
1. On the Power Apps Screen -> Insert a Text label and set its Text property to the code below.
Text = Switch(
Language(),
"en", "Welcome to Power Apps!",
"fr", "Bienvenue dans Power Apps!",
"es", "Bienvenido a Power Apps!",
"de", "Willkommen bei Power Apps!",
"Welcome to Power Apps!"
)
Where,
- “en”, “fr”, “es”, “de” = Different types of language codes
- “Welcome to Power Apps! = Default greeting [If user’s browser language does not match the above-specified languages]
2. Now, preview the app; the text label will display the text in the English language [user’s browser language], as shown below.
I hope you find this article helpful. This Power Apps article provides detailed information about how to use the Power Apps multilingual languages to build an app and how to work with Power Apps coalesce. We also covered the four different ways to make PowerApps multilingual applications.
Also, you may like:
- Power Apps Lower, Upper, and Proper Function
- Power Apps Value Function
- Power Apps Pen input
- Power Apps Barcode Scanner
- Power Apps Attachment Control
- Power Apps Set Text input Value Based On Another Field
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com
I highly miss how you would translate and deal with choice and choices fields? I mean not the label of such a control but with displaying the options in it in the desired language. How to filter, how to set the value correctly, when the choice/choices field is bound to a SharePoint List or Dataverse.