mit einem Klick
xaml-string-extraction
// 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.
// 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.
Build DAX Studio and run tests. Use when you need to verify changes compile correctly and all tests pass.
Step-by-step procedure for extracting hardcoded English strings from DAX Studio C# files and replacing them with resource references. Use when localizing ViewModels, services, or other C# code.
Procedure for migrating DAX Studio OptionsViewModel attributes ([DisplayName], [Description], [Category], [Subcategory]) to their localized equivalents. Use when localizing the Options UI.
Procedure for generating translations for DAX Studio resource files. Use when creating or updating translations for target languages (es, fr, de, zh-Hans, ja).
Procedure for localizing Spectre.Console.Cli command and option descriptions in DaxStudio.CommandLine. Use when internationalizing the dscmd command-line tool.
| name | xaml-string-extraction |
| description | 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. |
If not already present, add to the root element:
xmlns:loc="clr-namespace:DaxStudio.UI.Resources"
Scan ALL attributes for hardcoded English text. Target attributes include:
Content, Text, Header, Title, ToolTipWatermark, Label, DescriptionScreenTipTitle, ScreenTipText (Fluent.Ribbon)GroupName (when user-visible)NullValueText, EmptyText, PlaceholderTextFollow this naming convention:
| View Context | Pattern | Example |
|---|---|---|
| RibbonView | Ribbon_{Purpose} | Ribbon_RunQuery |
| RibbonView tooltip | Ribbon_{Purpose}_Tooltip | Ribbon_RunQuery_Tooltip |
| Dialog | {Dialog}_{Purpose} | ConnectionDialog_ServerLabel |
| Tool pane | {Pane}_{Purpose} | MetadataPane_SearchWatermark |
| Column header | Column_{Name} | Column_Duration |
| Tab header | Tab_{Name} | Tab_QueryResults |
<!-- 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}"/>
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)
Do NOT extract:
{Binding ...}, {StaticResource ...}, {DynamicResource ...}Fluent:KeyTip.Keys values (keyboard accelerators)d:DesignData, d:DataContext)