Add the locale in Power BI for Power BI visuals - Power BI (2024)

  • Article

Power BI supports a range of local languages. You can retrieve the Power BI locale language, and use it to display content in your visual.

The following tabs show examples of the same sample bar chart visual displaying content in different languages. Each of these bar charts was created using a different locale language (English, Basque, and Hindi) which is displayed in the tooltip.

  • English bar chart
  • Basque bar chart
  • Hindi bar chart

Add the locale in Power BI for Power BI visuals - Power BI (1)

Note

  • The localization manager in the visual's code is supported from API 1.10.0 and higher.
  • Localization is not supported for debugging the visual while in development.

How to add the local Power BI language to your visual

To add the local Power BI language to your visual, follow these steps:

  1. Set up your environment to display a language that isn't English.

  2. Get the local Power BI language.

  3. Set the visual display names

  4. Create a language folder.

  5. Add a resources file for each language.

  6. Create a new localizationManager instance.

  7. Call the getDisplayName function.

Step 1 - Set up your environment to display a language that isn't English

To test your visual, set Power BI to a language that isn't English. This section shows how to change the settings of Power BI Desktop and Power BI service, so that they use a local language that isn't English.

  • Power BI Desktop - Download the localized version of Power BI desktop from https://powerbi.microsoft.com

  • Power BI service - If you're using Power BI service (web portal), change your language in settings:

    1. Sign in to PowerBI.com.

    2. Navigate to Settings > General.

      Add the locale in Power BI for Power BI visuals - Power BI (2)

    3. Select Select display language to select the language you want Power BI to use.

      Add the locale in Power BI for Power BI visuals - Power BI (3)>

Step 2 - Get the locale Power BI language

The local Power BI language is passed as a string called locale during the initialization of the visual. If a locale language is changed in Power BI, the visual is generated again in the new language.

private locale: string;...this.locale = options.host.locale;

Note

In Power BI Desktop, the locale property contains the language of the installed Power BI Desktop.

Step 3 - Set the visual display names

Every visual displays information in the property pane. For example, a nonlocalized custom visual created by using the pbiviz new command shows the Category Data and Measure Data fields in the property pane.

Add the locale in Power BI for Power BI visuals - Power BI (4)

The property pane display fields are defined in the capabilities.json file. Every display field is defined using a displayName property. Add a displayNameKey to every display name you want to localize.

{ "dataRoles": [ { "displayName": "Category Data", "displayNameKey": "VisualCategoryDataNameKey1", "name": "category", "kind": "Grouping" }, { "displayName": "Measure Data", "displayNameKey": "VisualMeasureDataNameKey2", "name": "measure", "kind": "Measure" } ]}

Step 4 - Create a language folder

To create localized visuals, your project needs to have a language folder. In your project, create a folder called stringResources. The folder contains one sub folder for each local language you want your visual to support. For example, to support Arabic and Hebrew, add two folders in the following way:

Add the locale in Power BI for Power BI visuals - Power BI (5)

Step 5 - Add a resources file for each language

For each language you want your visual to support, add a resources.resjson JSON file in the appropriate stringResources sub folder. These files contain the locale language information, and the localized string values for every displayNameKey you want to replace.

Add the locale in Power BI for Power BI visuals - Power BI (6)

Every JSON file defines a single supported locale language. Add all the localization strings you're going to use into each resources.resjson file.

Examples

  • resources.resjson file with Russian strings for each displayNameKey.

    { ... "Role_Legend": "Обозначения", "Role_task": "Задача", "Role_StartDate": "Дата начала", "Role_Duration": "Длительность" ...}
  • resources.resjson file with Hebrew strings for each displayNameKey.

    { ... "Role_Legend": "מקרא", "Role_task": "משימה", "Role_StartDate": "תאריך התחלה", "Role_Duration": "משך זמן" ...}

Step 6 - Create a new localizationManager instance

Create a new localizationManager instance in your visual's code.

private localizationManager: ILocalizationManager;constructor(options: VisualConstructorOptions) { this.localizationManager = options.host.createLocalizationManager();}

Step 7 - Call the getDisplayName function

After creating a new localizationManager instance, you can call the localization manager's getDisplayName function with the string key argument you defined in resources.resjson.

For example, the following code returns Legend for en-US, and Обозначения for ru-RU.

let legend: string = this.localization.getDisplayName("Role_Legend");

Format pane and analytics pane localization

Note

Relevant to API version 5.1+

To support localization on format pane and analytics pane components, set localized string as follows:

displayName: this.localization.getDisplayName("Font_Color_DisplayNameKey");description: this.localization.getDisplayName("Font_Color_DescriptionKey");

For localize formatting model see format pane localization.
For localize formatting model utils see formatting model utils - localization.

Supported languages

The following table contains a list of all the languages supported in Power BI, and the string that the locale variable returns for each one.

Locale stringLanguage
ar-SAالعربية (Arabic)
bg-BGбългарски (Bulgarian)
ca-EScatalà (Catalan)
cs-CZčeština (Czech)
da-DKdansk (Danish)
de-DEDeutsche (German)
el-GRελληνικά (Greek)
en-USEnglish (English)
es-ESespañol service (Spanish)
et-EEeesti (Estonian)
eU-ESEuskal (Basque)
fi-FIsuomi (Finnish)
fr-FRfrançais (French)
gl-ESgalego (Galician)
he-ILעברית (Hebrew)
hi-INहिन्दी (Hindi)
hr-HRhrvatski (Croatian)
hu-HUmagyar (Hungarian)
id-IDBahasa Indonesia (Indonesian)
it-ITitaliano (Italian)
ja-JP日本の (Japanese)
kk-KZҚазақ (Kazakh)
ko-KR한국의 (Korean)
lt-LTLietuvos (Lithuanian)
lv-LVLatvijas (Latvian)
ms-MYBahasa Melayu (Malay)
nb-NOnorsk (Norwegian)
nl-NLNederlands (Dutch)
pl-PLpolski (Polish)
pt-BRportuguês (Portuguese)
pt-PTportuguês (Portuguese)
ro-ROromânesc (Romanian)
ru-RUрусский (Russian)
sk-SKslovenský (Slovak)
sl-SIslovenski (Slovenian)
sr-Cyrl-RSсрпски (Serbian)
sr-Latn-RSsrpski (Serbian)
sv-SEsvenska (Swedish)
th-THไทย (Thai)
tr-TRTürk (Turkish)
uk-UAукраїнський (Ukrainian)
vi-VNtiếng Việt (Vietnamese)
zh-CN中国 (Chinese-Simplified)
zh-TW中國 (Chinese-Tranditional)

Related content

Formatting utils

Questions? Ask the Power BI community

Add the locale in Power BI for Power BI visuals - Power BI (2024)

References

Top Articles
Ryan Reynolds’ Mint Mobile Acquired By T-Mobile For $1.3 Billion
Homes for Sale in Stuttgart, AR with Newest Listings | realtor.com®
Public Opinion Obituaries Chambersburg Pa
Cintas Pay Bill
Select The Best Reagents For The Reaction Below.
Bank Of America Appointments Near Me
Mlifeinsider Okta
Midway Antique Mall Consignor Access
Craigslist Greenville Craigslist
Johnston v. State, 2023 MT 20
Robert Malone é o inventor da vacina mRNA e está certo sobre vacinação de crianças #boato
OpenXR support for IL-2 and DCS for Windows Mixed Reality VR headsets
Craigslist Pets Sac
Busty Bruce Lee
Lesson 8 Skills Practice Solve Two-Step Inequalities Answer Key
Crossword Nexus Solver
Soccer Zone Discount Code
Best Uf Sororities
Las 12 mejores subastas de carros en Los Ángeles, California - Gossip Vehiculos
Craigslist In Visalia California
Ibukunore
Libinick
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
[PDF] NAVY RESERVE PERSONNEL MANUAL - Free Download PDF
Craigslistodessa
Webworx Call Management
WRMJ.COM
The Fabelmans Showtimes Near Baton Rouge
A Man Called Otto Showtimes Near Carolina Mall Cinema
Schooology Fcps
Ipcam Telegram Group
Tripcheck Oregon Map
Rush County Busted Newspaper
Bad Business Private Server Commands
Whas Golf Card
About Us | SEIL
Marie Peppers Chronic Care Management
The Transformation Of Vanessa Ray From Childhood To Blue Bloods - Looper
Seminary.churchofjesuschrist.org
062203010
VPN Free - Betternet Unlimited VPN Proxy - Chrome Web Store
Memberweb Bw
Oklahoma City Farm & Garden Craigslist
Ferhnvi
Streameast Io Soccer
This Doctor Was Vilified After Contracting Ebola. Now He Sees History Repeating Itself With Coronavirus
Egg Inc Wiki
Bismarck Mandan Mugshots
Skyward Login Wylie Isd
Rise Meadville Reviews
Naughty Natt Farting
Olay Holiday Gift Rebate.com
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 6416

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.