Skip to content

Commit 62b2816

Browse files
Merge pull request #2 from AndrewKeepCoding/1-hyperlink-does-not-get-localized-when-it-has-default-content
Fix Hyperlink not being localized when it has content already
2 parents 54ea7d1 + dc68116 commit 62b2816

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

WinUI3Localizer/LocalizationActions.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.UI.Xaml;
1+
using Microsoft.UI.Xaml;
22
using Microsoft.UI.Xaml.Documents;
33
using System;
44
using System.Collections.Generic;
@@ -30,15 +30,15 @@ public record ActionItem(Type TargetType, Action<ActionArguments> Action);
3030
}),
3131
new ActionItem(typeof(Bold), arguments =>
3232
{
33-
if (arguments.DependencyObject is Hyperlink target && target.Inlines.Count is 0)
33+
if (arguments.DependencyObject is Hyperlink target)
3434
{
3535
target.Inlines.Clear();
3636
target.Inlines.Add(new Run() { Text = arguments.Value });
3737
}
3838
}),
3939
new ActionItem(typeof(Hyperlink), arguments =>
4040
{
41-
if (arguments.DependencyObject is Hyperlink target && target.Inlines.Count is 0)
41+
if (arguments.DependencyObject is Hyperlink target)
4242
{
4343
target.Inlines.Clear();
4444
target.Inlines.Add(new Run() { Text = arguments.Value });

WinUI3Localizer/WinUI3Localizer.csproj

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<Product>WinUI3Localizer</Product>
3030
<Copyright>Copyright (c) Andrew KeepCoding 2023</Copyright>
3131
<Authors>Andrew KeepCoding</Authors>
32+
<PackageReadMeFile>README.md</PackageReadMeFile>
3233
</PropertyGroup>
3334

3435
<ItemGroup>
@@ -37,7 +38,12 @@
3738
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
3839
</ItemGroup>
3940

41+
<ItemGroup>
42+
<None Include="..\README.md" Pack="true" PackagePath="\" />
43+
</ItemGroup>
44+
4045
<ItemGroup>
4146
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
4247
</ItemGroup>
48+
4349
</Project>

0 commit comments

Comments
 (0)