Skip to content

Commit 65821b2

Browse files
Merge pull request #27 from AndrewKeepCoding/25-optionsuseuidwhenlocalizedstringnotfound-does-not-work-with-uid-on-xaml
Remove UseUidWhenLocalizedStringNotFound from Options
2 parents 52f19dc + 827b0a8 commit 65821b2

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ Add this ItemGroup in the project file (\*.csproj) of your app.
5858
.SetOptions(options =>
5959
{
6060
options.DefaultLanguage = "en-US";
61-
options.UseUidWhenLocalizedStringNotFound = true;
6261
})
6362
.Build();
6463
}
@@ -89,7 +88,6 @@ Add this ItemGroup in the project file (\*.csproj) of your app.
8988
.SetOptions(options =>
9089
{
9190
options.DefaultLanguage = "en-US";
92-
options.UseUidWhenLocalizedStringNotFound = true;
9391
})
9492
.Build();
9593
}

WinUI3Localizer.SampleApp/App.xaml.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ private static IHost BuildHost()
9898
// .SetOptions(options =>
9999
// {
100100
// options.DefaultLanguage = "ja";
101-
// options.UseUidWhenLocalizedStringNotFound = true;
102101
// })
103102
// .Build()
104103
// .GetAwaiter()
@@ -141,7 +140,6 @@ private async Task InitializeLocalizer()
141140
.SetOptions(options =>
142141
{
143142
options.DefaultLanguage = "en-US";
144-
options.UseUidWhenLocalizedStringNotFound = true;
145143
})
146144
//.AddLocalizationAction(new LocalizationActionItem(typeof(Hyperlink), arguments =>
147145
//{
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
namespace WinUI3Localizer;
1+
namespace WinUI3Localizer;
22

33
public partial class Localizer
44
{
55
public class Options
66
{
77
public string DefaultLanguage { get; set; } = "en-US";
88

9-
public bool UseUidWhenLocalizedStringNotFound { get; set; } = false;
10-
119
public bool DisableDefaultLocalizationActions { get; set; } = false;
1210
}
1311
}

WinUI3Localizer/Localizer.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ public string GetLocalizedString(string uid)
117117
throw localizerException;
118118
}
119119

120-
return this.options.UseUidWhenLocalizedStringNotFound is true
121-
? uid
122-
: string.Empty;
120+
return string.Empty;
123121
}
124122

125123
public IEnumerable<string> GetLocalizedStrings(string uid)
@@ -147,9 +145,7 @@ public IEnumerable<string> GetLocalizedStrings(string uid)
147145
throw localizerException;
148146
}
149147

150-
return this.options.UseUidWhenLocalizedStringNotFound is true
151-
? new string[] { uid }
152-
: Array.Empty<string>();
148+
return Array.Empty<string>();
153149
}
154150

155151
public LanguageDictionary GetCurrentLanguageDictionary() => CurrentDictionary;

0 commit comments

Comments
 (0)