OpenParable
Skip to content
← Back to skills

Xaml String Extraction

Development
xaml-string-extraction

Xaml String Extraction is an Agent Skill for development published in the DaxStudio/DaxStudio repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Step-by-step procedure for extracting hardcoded English strings from a DAX Studio XAML view file and replacing them with {x:Static} resource references. Use when localizing or internationalizing XAML files.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/DaxStudio/DaxStudio/blob/HEAD/.github/skills/xaml-string-extraction/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/xaml-string-extraction, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

XAML String Extraction for i18n

Step 1: Add Resource Namespace

If not already present, add to the root element:

xmlns:loc="clr-namespace:DaxStudio.UI.Resources"

Step 2: Identify Extractable Strings

Scan ALL attributes for hardcoded English text. Target attributes include:

  • Content, Text, Header, Title, ToolTip
  • Watermark, Label, Description
  • ScreenTipTitle, ScreenTipText (Fluent.Ribbon)
  • GroupName (when user-visible)
  • NullValueText, EmptyText, PlaceholderText

Step 3: Generate Resource Key

Follow this naming convention:

View ContextPatternExample
RibbonViewRibbon_{Purpose}Ribbon_RunQuery
RibbonView tooltipRibbon_{Purpose}_TooltipRibbon_RunQuery_Tooltip
Dialog{Dialog}_{Purpose}ConnectionDialog_ServerLabel
Tool pane{Pane}_{Purpose}MetadataPane_SearchWatermark
Column headerColumn_{Name}Column_Duration
Tab headerTab_{Name}Tab_QueryResults

Step 4: Replace String

<!-- BEFORE -->
<Button Content="Run Query" ToolTip="Execute the current DAX query (F5)"/>

<!-- AFTER -->
<Button Content="{x:Static loc:Strings.Ribbon_RunQuery}"
        ToolTip="{x:Static loc:Strings.Ribbon_RunQuery_Tooltip}"/>

Step 5: Record Resx Entries

For each extraction, record the key and English value to add to src\DaxStudio.UI\Resources\Strings.resx:

Ribbon_RunQuery = Run Query
Ribbon_RunQuery_Tooltip = Execute the current DAX query (F5)

Exclusion Rules

Do NOT extract:

  • Binding expressions: {Binding ...}, {StaticResource ...}, {DynamicResource ...}
  • DAX keywords: EVALUATE, CALCULATE, SUMMARIZE, MEASURE, VAR, RETURN
  • Technical terms: VertiPaq, Storage Engine, Formula Engine, DirectQuery, xmSQL
  • Product names: DAX Studio, Power BI, Analysis Services, Excel, Power Pivot
  • Empty strings, whitespace, or numeric-only values
  • Icon characters (single glyphs used as icons)
  • Keyboard shortcuts: Ctrl+C, F5, Ctrl+Shift+Enter
  • Fluent:KeyTip.Keys values (keyboard accelerators)
  • Converter parameters that are not user-visible
  • Design-time data (d:DesignData, d:DataContext)