Handling Localization in PCF Components: A Practical Walkthrough
When you build a PowerApps Component Framework (PCF) component that will be used across multiple geographies, need to serve labels, button captions, validation messages, and tooltips in the user's preferred language. PCF has a built-in answer based on .resx resource files, the same format used by .NET applications. The mechanism is elegant in production — but surprisingly tricky during local development. This walkthrough takes you through the full setup, step by step, and then explains a problem that arises while locally debugging your PCF. Step 1 — Create the strings folder and your first .resx file PCF expects your localized strings to live in a folder (the conventional name is strings ) inside your component directory. Each language gets its own file, named with the pattern: <ComponentName>.<LCID>.resx The <LCID> part is the numeric Locale ID , not the textual code ( en-US , it-IT ). The framework relies on this naming convention to identify which file to load for a given user. Common LCIDs: Language LCID English (en-US) 1033 Italian (it-IT) 1040 German (de-DE) 1031 French (fr-FR) 1036 Spanish (es-ES) 3082 Japanese (ja-JP) 1041 Chinese Simplified (zh-CN) 2052 Portuguese (pt-BR) 1046 For a component called EquipmentGrid , the structure looks like this: EquipmentGrid/ ├── ControlManifest.Input.xml ├── index.ts └── strings/ ├── EquipmentGrid.1033.resx ├── EquipmentGrid.1040.resx └── EquipmentGrid.1031.resx Tip: Always include 1033.resx (English). The PCF runtime falls back to the first <resx> declared in the manifest when the user's preferred language isn't available, and English is the safest default. Step 2 — Author the resource file content A .resx file is just XML. Here's a minimal Italian version ( EquipmentGrid.1040.resx ): <?xml version="1.0" encoding="utf-8"?> <root> <resheader name= "resmimetype" > <value> text/microsoft-resx </value> </resheader> <resheader name= "version" > <value> 2.0 </value> </resheader> <resheader name= "reader" > <value> System.Resou