If you have ever worked on a Dynamics 365 CE or Power Apps model-driven app that serves users from multiple countries, you already know how important language support is. Most of us start confidently because Dynamics 365 handles translations for standard tables automatically. But the moment you introduce custom tables, JavaScript alerts, or HTML web resources, things start getting confusing. If you are wondering, "How do I translate custom web resource content properly?" - you are not alone. In this blog, I'll walk you through practical and supported ways to handle translations in Dynamics 365 CE.
Overview:
Dynamics 365 supports multilingual applications, but translations are handled differently depending on what you are translating.
- Standard & custom tables - supported out of the box
- Field labels, option sets, views - supported via export/import
- JavaScript & HTML web resources - require custom handling
- Out-of-the-box translation for tables
- Two reliable approaches for translating web resources
Out of the box way
Dynamics 365 provides a built-in way to translate metadata such as table names, field labels, and option set values. This works for both standard and custom tables.
Steps to Export and Import Translations
- Open Power Apps and navigate to Solutions
- Open your target solution
- Click on Translations
- Select Export Translations
- Download and extract the ZIP file
- Open CrmTranslations.xml in Excel
- Add translations for the required languages
- Zip the files again and import them back
Once imported, Dynamics 365 automatically displays translated labels based on the user’s selected language.
Important Note: This approach works only for metadata. It does not translate JavaScript alerts, HTML content, or other web resources.
For the detailed information, you can check this blog from Carl de Souza
Web Resource Way:
Web resources such as:
- JavaScript alert messages
- Form notifications
- Custom HTML pages
are not covered by the translation XML file. To localize these, we need to use one of the following approaches.
- Custom JavaScript Helper Method
- RESX Web Resource Method (Recommended)
Custom Function Way
This approach is useful when you want quick control over translations using JavaScript. The idea is simple:
- Create a helper JavaScript file
- Store translations per language (LCID)
- Detect the user’s language at runtime
Below is the code for translation-helper.js
Below is the code for showAlerts.js with custom helper method
Make sure the helper script is added as a dependency to your main JavaScript web resource.
After saving and publishing, I've added the function to the on-save event of the appointment table. For the demonstration, i have opened a record and saved it again it is showing the below alert.
Then I will change the language by following the below steps.
- navigating to the Settings Icon(Gear Icon on Top navigation bar)
- Select Personalization Settings from the pane
- Open the Languages tab and change the language
Then you'll notice the application language is changed. Just navigate to appointments, open and save any record you'll see the alert in the selected language with the text we have added in the helper script. Please refer the below image for that
2. RESX Way
This is the cleanest and most scalable approach and is recommended by Microsoft for translating web resources.
Why RESX Files?- Native support in Dynamics 365
- Automatic language resolution
- Cleaner JavaScript code
- Easier maintenance for large applications
Note: I have followed the naming convention like messages.[LCID].resx. The LCID in the file name allows Dynamics 365 to automatically load the correct language based on the user's settings.
I have created resx three files.These resx files can be edited with the resx editor extension for vs code, I have opened these files and added the values. Refer to the below images
English
Arabic
Japanese
After that I have added the below script to the on-save of the appointment main form
Below is the code for showAlertsUsingRESX.js to be added on the on-save of appointment main form
Add all RESX files as dependencies to your JavaScript web resource and publish the changes.
Note: We can add dependencies to the web resources by clicking on the View dependencies link and add the dependencies. Refer to the below images
Save and Publish and check the form and change the language to Japanese and you'll get the alert like below image as we have added the value in the messages.1041.resx
Now, when the user switches their application language, Dynamics 365 automatically picks the correct translation.
References:
- getGlobalContext.userSettings (Client API reference) in model-driven apps - Power Apps | Microsoft Learn
- LCID (Locale ID) | Microsoft Learn
- getFormType (Client API reference) in model-driven apps - Power Apps | Microsoft Learn
- openAlertDialog (Client API reference) in model-driven apps - Power Apps | Microsoft Learn
- String (RESX) web resources (model-driven apps) - Power Apps | Microsoft Learn









