From 638940a035ebfdf2180c8b3ccaf77cd2e7fc8644 Mon Sep 17 00:00:00 2001 From: HazardSy Date: Sun, 18 Feb 2024 14:33:11 +0100 Subject: [PATCH] Feat: add localization for Liked Songs --- src/NzbDrone.Core/ImportLists/Spotify/SpotifyPlaylist.cs | 7 ++++++- src/NzbDrone.Core/Localization/Core/en.json | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/ImportLists/Spotify/SpotifyPlaylist.cs b/src/NzbDrone.Core/ImportLists/Spotify/SpotifyPlaylist.cs index 553c857cc..c1f6ad3c1 100644 --- a/src/NzbDrone.Core/ImportLists/Spotify/SpotifyPlaylist.cs +++ b/src/NzbDrone.Core/ImportLists/Spotify/SpotifyPlaylist.cs @@ -5,6 +5,7 @@ using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.MetadataSource; using NzbDrone.Core.Parser; using NzbDrone.Core.Validation; @@ -22,15 +23,19 @@ namespace NzbDrone.Core.ImportLists.Spotify IConfigService configService, IParsingService parsingService, IHttpClient httpClient, + ILocalizationService localizationService, Logger logger) : base(spotifyProxy, requestBuilder, importListStatusService, importListRepository, configService, parsingService, httpClient, logger) { + _localizationService = localizationService; } public override string Name => "Spotify Playlists"; private const string LIKEDSONGSID = "LikedSongs"; + private readonly ILocalizationService _localizationService; + public override IList Fetch(SpotifyWebAPI api) { return Settings.PlaylistIds.SelectMany(x => Fetch(api, x)).ToList(); @@ -162,7 +167,7 @@ namespace NzbDrone.Core.ImportLists.Spotify { id = p.Id, name = p.Name - }).Prepend(new { id = LIKEDSONGSID, name = "Liked Songs" }) // TODO : Add Translation + }).Prepend(new { id = LIKEDSONGSID, name = _localizationService.GetLocalizedString("LikedSongs") }) } }; } diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 4b5f966c9..50e87df14 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -611,6 +611,7 @@ "LidarrSupportsAnyIndexerThatUsesTheNewznabStandardAsWellAsOtherIndexersListedBelow": "{appName} supports any indexer that uses the Newznab standard, as well as other indexers listed below.", "LidarrSupportsMultipleListsForImportingAlbumsAndArtistsIntoTheDatabase": "{appName} supports multiple lists for importing Albums and Artists into the database.", "LidarrTags": "{appName} Tags", + "LikedSongs": "Liked Songs", "Links": "Links", "ListRefreshInterval": "List Refresh Interval", "ListWillRefreshEveryInterp": "List will refresh every {0}",