Skip to content

Commit

Permalink
Localize renamed on
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramo-Y committed Jul 13, 2024
1 parent 7337f23 commit 23056ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/BulkRename/Controllers/HistoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
using BulkRename.Interfaces;
using BulkRename.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;

public class HistoryController : Controller
{
private readonly IPersistanceService _persistanceService;

private readonly IStringLocalizer<SharedResource> _sharedLocalizer;

private static readonly Dictionary<string, List<Series>> _dictionary = [];

public HistoryController(IPersistanceService persistanceService)
public HistoryController(IPersistanceService persistanceService, IStringLocalizer<SharedResource> sharedLocalizer)
{
_persistanceService = persistanceService;
_sharedLocalizer = sharedLocalizer;
}

public IActionResult Index()
Expand All @@ -22,6 +26,7 @@ public IActionResult Index()

public async Task<IActionResult> LoadHistory()
{
var renamedOn = _sharedLocalizer["RenamedOn"];
_dictionary.Clear();

var renamingSessionToEpisodes = await _persistanceService.LoadRenamingHistory();
Expand All @@ -47,7 +52,7 @@ public async Task<IActionResult> LoadHistory()
});
}

var key = $"{renamingSessionToEpisode.RenamingSession.RenName}, Renamed on: {renamingSessionToEpisode.RenamingSession.RenExecutingDateTime:yyyy-MM-dd HH:mm:ss}";
var key = $"{renamingSessionToEpisode.RenamingSession.RenName}, {renamedOn}: {renamingSessionToEpisode.RenamingSession.RenExecutingDateTime:yyyy-MM-dd HH:mm:ss}";
_dictionary.Add(key, series);
}

Expand Down
3 changes: 3 additions & 0 deletions src/BulkRename/Resources/SharedResource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ and restarting the app.</value>
<data name="PreviewRenamingOfTvShows" xml:space="preserve">
<value>Preview Renaming of TV-Shows</value>
</data>
<data name="RenamedOn" xml:space="preserve">
<value>Renamed on</value>
</data>
<data name="Series" xml:space="preserve">
<value>Series</value>
</data>
Expand Down

0 comments on commit 23056ed

Please sign in to comment.