Skip to main content

Localization and Translation

Tailoring your app to different regions is easier than ever with AI. Grial MCP Server helps you localize your app by dynamically loading string literals in your XAML, and also assists in translating those strings.

Localize your app

The first step to tailor your app to different languages or variants is to create/update a .resx file with all the string literals in your XAML files.
Ask your agent to localize your app — it should execute the LocalizeSolution tool.

This tool will:

  • Create (if it doesn’t exist) and/or update AppResources.resx (the base resource file).
  • Add entries with a key and the original string value.
  • Replace inline string literals in XAML with a translation binding, e.g.:
    {grial:Translate Key=the-app-resources-string-key}
    The value will be taken from the appropriate .resx file for the device region (e.g., .ar.resx, .es.resx, .en-GB.resx).

Translating the app

Translating your app means creating a specific .resx file for each region/locale you want to support.
For example, if your AppResources.resx file is in English, create AppResources.es.resx to support Spanish.
You can also tailor Spanish to a specific location; for Uruguay you would use AppResources.es-UY.resx.

Ask your agent to translate your solution — it should execute the Translate tool from the Grial MCP Server. This tool receives an array of regions/locales to translate to.

Translation tool call

The tool will:

  • Create an AppResources.*.resx file for each requested region/locale.
  • Translate every key–value pair from the base AppResources.resx into each new file.

To perform translations, Grial MCP Server calls the LLM through the MCP protocol. For that reason, it will ask your permission to make that call.

Mcp model call permission request

Once the translation tool finishes, you will see the new .resx files created, each populated with the translated strings.