Multilingual support for Copilot Studio agent
There is often a need for agents that can speak multiple languages. By default, almost all language models already do this, but not fully automatically or comprehensively. The goal is to create a capability for a Copilot Studio agent that detects the language the user wants to communicate in and sets the configurations accordingly. Sounds doable, right?
I’ll guide you through the installation steps.
1. Select the agent
Choose the agent you want to add multilingual support to.
2. Edit the Conversation Start topic
Add Quick Reply options to allow users to select their preferred language easily. For example:
- I would like to speak English
- Haluan puhua suomea
These act as quick selectors for language preference.
3. Configure languages
Go to Copilot Studio → Settings → Languages and add your preferred languages.
4. Create a custom topic: Automatic Language Detector
This topic should:
- Detect the user’s desired language from their input.
- Update the system variable for language.
- Confirm the selection to the user.
- End the topic.
Steps to build the topic:
- Use the default trigger: The agent chooses.
- Add a trigger description, e.g. (This topic is triggered when the user wants to change the conversation language or indicates a specific language. Example phrases: “Use English”, “suomen kieli”, “I want to use Finnish”, “Haluan puhua suomea”)
- Add a tool → New Prompt.
- For prompt inputs, select LastMessage.Text.
- For outputs, create a variable:
Var_DetectedLanguage.
Prompt settings:
- Name: Language detector.
- Add content for instructions and a static message for testing.
- Test the prompt to ensure it returns the expected language output.
- Save.
Add conditions:
- For each supported language, create a condition using:
Var_DetectedLanguage.structuredOutput.language. - If the variable equals Finnish, English, etc., set
User.Languageaccordingly. - Add confirmation messages for each condition.
- For unsupported languages (All other conditions), add a message like: "You requested an unsupported language. Only XXX and XXX are supported."
- End the topic.
5. Manual translation of hard-coded texts
The agent can translate knowledge source answers automatically, but "hard-coded" topic texts require manual localisation:
- Go to Settings → Languages.
- Select a secondary language.
- Download the localisation file (JSON).
- Open the file in an editor (e.g., VS Code).
- Translate the text (AI tools can help).
- Save and upload the file back.
- Repeat for each secondary language.
Done! Now your agent supports multiple languages. It’s not too hard, right?
Extra tip:
Problems to translate each language specific JSON file? Do you want to try automated process (Easiest for Large Files):
Download JSON: In Copilot Studio > Settings > Languages, select your target language and download the localization file (JSON or ResX format).
Open in VS Code: Open the downloaded localizations.json file in Visual Studio Code.
Use Copilot for Translation: Open the VS Code chat (Copilot) and use a prompt like: "Translate all the values in this JSON file to [Target Language]. DO NOT change the keys, only the values.".
Upload: Save the translated JSON file and upload it back in Copilot Studio via the "Upload localizations" panel.
