Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco committed Mar 18, 2024
1 parent b905429 commit aeb0187
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/My.Extensions.Localization.Json/JsonStringLocalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class JsonStringLocalizer : IStringLocalizer
private readonly IResourceStringProvider _resourceStringProvider;
private readonly ILogger _logger;

private string _searchedLocation;
private string _searchedLocation = string.Empty;

public JsonStringLocalizer(
JsonResourceManager jsonResourceManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ public async Task LocalizerReturnsTranslationFromInnerClass()
{
app.UseRequestLocalization("en", "ar");

app.Run(context =>
app.Run(async context =>
{
var localizer = context.RequestServices.GetService<IStringLocalizer<Model>>();

LocalizationHelper.SetCurrentCulture("ar");

Assert.Equal("مرحباً", localizer["Hello"]);

return Task.FromResult(0);
await Task.CompletedTask;
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ public async void CultureBasedResourcesUsesIStringLocalizer()
{
app.UseRequestLocalization("en-US", "fr-FR");

app.Run(context =>
app.Run(async context =>
{
var localizer = context.RequestServices.GetService<IStringLocalizer<JsonStringLocalizer>>();

LocalizationHelper.SetCurrentCulture("fr-FR");

Assert.Equal("Bonjour", localizer["Hello"]);

return Task.FromResult(0);
await Task.CompletedTask;
});
});

Expand Down

0 comments on commit aeb0187

Please sign in to comment.