feat(i18n): localize Avalonia view strings via loc:Tr markup
Extract ~165 hardcoded UI strings across islands, modals, planning and
shell views into en.json; replace with {loc:Tr} bindings.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Islands"
|
||||
xmlns:islands="using:ClaudeDo.Ui.Views.Islands"
|
||||
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
||||
xmlns:loc="using:ClaudeDo.Ui.Localization"
|
||||
x:Class="ClaudeDo.Ui.Views.Islands.DetailsIslandView"
|
||||
x:DataType="vm:DetailsIslandViewModel">
|
||||
<DockPanel>
|
||||
@@ -15,7 +16,7 @@
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Button Grid.Column="0" Classes="icon-btn"
|
||||
Command="{Binding DeleteTaskCommand}"
|
||||
ToolTip.Tip="Delete task"
|
||||
ToolTip.Tip="{loc:Tr details.deleteTaskTip}"
|
||||
VerticalAlignment="Center">
|
||||
<PathIcon Data="{StaticResource Icon.Trash}" Width="14" Height="14"
|
||||
Foreground="{DynamicResource BloodBrush}"/>
|
||||
@@ -27,7 +28,7 @@
|
||||
VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="2" Classes="icon-btn"
|
||||
Command="{Binding CloseDetailsCommand}"
|
||||
ToolTip.Tip="Close"
|
||||
ToolTip.Tip="{loc:Tr details.closeTip}"
|
||||
VerticalAlignment="Center">
|
||||
<PathIcon Data="{StaticResource Icon.X}" Width="14" Height="14"/>
|
||||
</Button>
|
||||
@@ -52,7 +53,7 @@
|
||||
Text="{Binding TaskIdBadge}"
|
||||
Margin="0,0,0,4"
|
||||
Cursor="Hand"
|
||||
ToolTip.Tip="Copy task ID"
|
||||
ToolTip.Tip="{loc:Tr details.copyTaskIdTip}"
|
||||
Tapped="OnTaskIdTapped"/>
|
||||
<TextBox Text="{Binding EditableTitle, Mode=TwoWay}"
|
||||
FontSize="{StaticResource FontSizeTaskTitle}" FontWeight="Medium"
|
||||
@@ -67,14 +68,14 @@
|
||||
Classes="icon-btn star-btn"
|
||||
Classes.on="{Binding Task.IsStarred}"
|
||||
Command="{Binding ToggleStarCommand}"
|
||||
ToolTip.Tip="Star"
|
||||
ToolTip.Tip="{loc:Tr details.starTip}"
|
||||
VerticalAlignment="Top"
|
||||
Margin="6,0,0,0">
|
||||
<PathIcon Data="{StaticResource Icon.Star}" Width="14" Height="14"/>
|
||||
</Button>
|
||||
|
||||
<Button Grid.Column="3" Classes="icon-btn"
|
||||
ToolTip.Tip="Agent settings"
|
||||
ToolTip.Tip="{loc:Tr details.agentSettingsTip}"
|
||||
IsEnabled="{Binding IsAgentSectionEnabled}"
|
||||
VerticalAlignment="Top"
|
||||
Margin="6,0,0,0">
|
||||
@@ -82,10 +83,10 @@
|
||||
<Button.Flyout>
|
||||
<Flyout Placement="BottomEdgeAlignedRight" ShowMode="Standard">
|
||||
<StackPanel Width="340" Spacing="10" Margin="4">
|
||||
<TextBlock Text="Agent settings (overrides)" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{loc:Tr details.agentSettingsHeading}" FontWeight="SemiBold"/>
|
||||
|
||||
<StackPanel Spacing="2">
|
||||
<TextBlock Classes="field-label" Text="Model"/>
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr details.modelLabel}"/>
|
||||
<ComboBox ItemsSource="{Binding TaskModelOptions}"
|
||||
SelectedItem="{Binding TaskModelSelection, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
@@ -95,14 +96,14 @@
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="2">
|
||||
<TextBlock Classes="field-label" Text="System prompt (appended)"/>
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr details.systemPromptLabel}"/>
|
||||
<TextBox Text="{Binding TaskSystemPrompt, Mode=TwoWay}"
|
||||
AcceptsReturn="True" TextWrapping="Wrap" MinHeight="70"
|
||||
PlaceholderText="{Binding EffectiveSystemPromptHint}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Spacing="2">
|
||||
<TextBlock Classes="field-label" Text="Agent file"/>
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr details.agentFileLabel}"/>
|
||||
<ComboBox ItemsSource="{Binding TaskAgentOptions}"
|
||||
SelectedItem="{Binding TaskSelectedAgent, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch">
|
||||
@@ -136,17 +137,17 @@
|
||||
<Border Classes="section-divider"
|
||||
IsVisible="{Binding Task.IsPlanningParent}">
|
||||
<StackPanel Spacing="8">
|
||||
<TextBlock Classes="section-label" Text="MERGE" Margin="0,0,0,2"/>
|
||||
<TextBlock Classes="section-label" Text="{loc:Tr details.mergeLabel}" Margin="0,0,0,2"/>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Merge target"/>
|
||||
<TextBlock Classes="field-label" Text="{loc:Tr details.mergeTargetLabel}"/>
|
||||
<ComboBox ItemsSource="{Binding MergeTargetBranches}"
|
||||
SelectedItem="{Binding SelectedMergeTarget, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Button Classes="btn" Content="Review combined diff"
|
||||
<Button Classes="btn" Content="{loc:Tr details.reviewCombinedDiff}"
|
||||
Command="{Binding ReviewCombinedDiffCommand}"/>
|
||||
<Button Classes="btn" Content="Merge all subtasks"
|
||||
<Button Classes="btn" Content="{loc:Tr details.mergeAllSubtasks}"
|
||||
IsEnabled="{Binding CanMergeAll}"
|
||||
Command="{Binding MergeAllCommand}"
|
||||
ToolTip.Tip="{Binding MergeAllDisabledReason}"/>
|
||||
@@ -161,9 +162,9 @@
|
||||
<!-- Steps section -->
|
||||
<Border Classes="section-divider">
|
||||
<StackPanel Spacing="6">
|
||||
<TextBlock Classes="section-label" Text="STEPS" Margin="0,0,0,2"/>
|
||||
<TextBlock Classes="section-label" Text="{loc:Tr details.stepsLabel}" Margin="0,0,0,2"/>
|
||||
<TextBox Text="{Binding NewSubtaskTitle, Mode=TwoWay}"
|
||||
PlaceholderText="Add a step..."
|
||||
PlaceholderText="{loc:Tr details.addStepPlaceholder}"
|
||||
Padding="8"
|
||||
Background="{DynamicResource Surface2Brush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
@@ -240,14 +241,14 @@
|
||||
<TextBlock Classes="meta"
|
||||
Text="▸"
|
||||
IsVisible="{Binding !IsDescriptionExpanded}"/>
|
||||
<TextBlock Classes="section-label" Text="DETAILS"/>
|
||||
<TextBlock Classes="section-label" Text="{loc:Tr details.detailsLabel}"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon-btn"
|
||||
Padding="6,2"
|
||||
Margin="0,0,4,0"
|
||||
ToolTip.Tip="Copy description to clipboard"
|
||||
ToolTip.Tip="{loc:Tr details.copyDescriptionTip}"
|
||||
IsVisible="{Binding IsDescriptionExpanded}"
|
||||
Click="OnCopyDescriptionClick">
|
||||
<PathIcon Data="{StaticResource Icon.Copy}" Width="11" Height="11"/>
|
||||
@@ -256,17 +257,17 @@
|
||||
Classes="btn"
|
||||
Command="{Binding ToggleEditDescriptionCommand}"
|
||||
Padding="8,3"
|
||||
ToolTip.Tip="Toggle edit/preview"
|
||||
ToolTip.Tip="{loc:Tr details.toggleEditPreviewTip}"
|
||||
IsVisible="{Binding IsDescriptionEditorVisible}">
|
||||
<TextBlock Text="Preview"/>
|
||||
<TextBlock Text="{loc:Tr details.previewBtn}"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
Classes="btn"
|
||||
Command="{Binding ToggleEditDescriptionCommand}"
|
||||
Padding="8,3"
|
||||
ToolTip.Tip="Toggle edit/preview"
|
||||
ToolTip.Tip="{loc:Tr details.toggleEditPreviewTip}"
|
||||
IsVisible="{Binding IsDescriptionPreviewVisible}">
|
||||
<TextBlock Text="Edit"/>
|
||||
<TextBlock Text="{loc:Tr details.editBtn}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
@@ -275,7 +276,7 @@
|
||||
TextWrapping="Wrap"
|
||||
MinHeight="80"
|
||||
MaxHeight="320"
|
||||
PlaceholderText="Add task details (markdown supported)..."
|
||||
PlaceholderText="{loc:Tr details.descriptionPlaceholder}"
|
||||
Padding="8"
|
||||
FontFamily="{DynamicResource MonoFont}"
|
||||
FontSize="{StaticResource FontSizeBody}"
|
||||
|
||||
Reference in New Issue
Block a user