Skip to content

Commit 142ee5a

Browse files
committed
ux: use localized text instead of hard-coded string annotated (#1305)
1 parent afc8a77 commit 142ee5a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/Commands/QueryTags.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ public QueryTags(string repo)
2929
continue;
3030

3131
var name = subs[0].Substring(10);
32-
var message = subs[5].Trim();
3332
tags.Add(new Models.Tag()
3433
{
3534
Name = name,
3635
IsAnnotated = subs[1].Equals("tag", StringComparison.Ordinal),
3736
SHA = string.IsNullOrEmpty(subs[3]) ? subs[2] : subs[3],
3837
CreatorDate = ulong.Parse(subs[4]),
39-
Message = string.IsNullOrEmpty(message) ? name : message,
38+
Message = subs[5].Trim(),
4039
});
4140
}
4241

src/Views/TagsView.axaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
<Border Height="24" Background="Transparent" PointerPressed="OnRowPointerPressed" DoubleTapped="OnDoubleTappedNode" ContextRequested="OnRowContextRequested" ToolTip.Tip="{Binding ToolTip}">
3030
<Border.DataTemplates>
3131
<DataTemplate DataType="vm:TagTreeNodeToolTip">
32-
<StackPanel Orientation="Vertical" MinWidth="200">
33-
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
32+
<StackPanel Orientation="Vertical" Spacing="6">
33+
<StackPanel Orientation="Horizontal">
3434
<Path Width="10" Height="10" Data="{StaticResource Icons.Tag}"/>
3535
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Text="{Binding Name}"/>
3636
<Border Background="Green" Margin="4,0,0,0" CornerRadius="4" IsVisible="{Binding IsAnnotated}">
37-
<TextBlock Text="annotated" Classes="primary" Margin="4,0" Foreground="#FFDDDDDD"/>
37+
<TextBlock Text="{DynamicResource Text.CreateTag.Type.Annotated}" Classes="primary" Margin="4,0" Foreground="#FFDDDDDD"/>
3838
</Border>
3939
</StackPanel>
4040

41-
<TextBlock Text="{Binding Message}"/>
41+
<TextBlock Text="{Binding Message}" IsVisible="{Binding Message, Converter={x:Static c:StringConverters.IsNotNullOrWhitespace}}"/>
4242
</StackPanel>
4343
</DataTemplate>
4444
</Border.DataTemplates>
@@ -86,16 +86,16 @@
8686
<DataTemplate DataType="m:Tag">
8787
<Border Height="24" Background="Transparent" PointerPressed="OnRowPointerPressed" ContextRequested="OnRowContextRequested">
8888
<ToolTip.Tip>
89-
<StackPanel Orientation="Vertical" MinWidth="200">
90-
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
89+
<StackPanel Orientation="Vertical" Spacing="6">
90+
<StackPanel Orientation="Horizontal">
9191
<Path Width="10" Height="10" Data="{StaticResource Icons.Tag}"/>
9292
<TextBlock FontWeight="Bold" Margin="4,0,0,0" Text="{Binding Name}"/>
9393
<Border Background="Green" Margin="4,0,0,0" CornerRadius="4" IsVisible="{Binding IsAnnotated}">
94-
<TextBlock Text="annotated" Classes="primary" Margin="4,0" Foreground="#FFDDDDDD"/>
94+
<TextBlock Text="{DynamicResource Text.CreateTag.Type.Annotated}" Classes="primary" Margin="4,0" Foreground="#FFDDDDDD"/>
9595
</Border>
9696
</StackPanel>
9797

98-
<TextBlock Text="{Binding Message}"/>
98+
<TextBlock Text="{Binding Message}" IsVisible="{Binding Message, Converter={x:Static c:StringConverters.IsNotNullOrWhitespace}}"/>
9999
</StackPanel>
100100
</ToolTip.Tip>
101101

0 commit comments

Comments
 (0)