Feat: add localization for Liked Songs

This commit is contained in:
HazardSy 2024-02-18 14:33:11 +01:00
commit 638940a035
2 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,7 @@ using NLog;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Localization;
using NzbDrone.Core.MetadataSource; using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
@ -22,15 +23,19 @@ namespace NzbDrone.Core.ImportLists.Spotify
IConfigService configService, IConfigService configService,
IParsingService parsingService, IParsingService parsingService,
IHttpClient httpClient, IHttpClient httpClient,
ILocalizationService localizationService,
Logger logger) Logger logger)
: base(spotifyProxy, requestBuilder, importListStatusService, importListRepository, configService, parsingService, httpClient, logger) : base(spotifyProxy, requestBuilder, importListStatusService, importListRepository, configService, parsingService, httpClient, logger)
{ {
_localizationService = localizationService;
} }
public override string Name => "Spotify Playlists"; public override string Name => "Spotify Playlists";
private const string LIKEDSONGSID = "LikedSongs"; private const string LIKEDSONGSID = "LikedSongs";
private readonly ILocalizationService _localizationService;
public override IList<SpotifyImportListItemInfo> Fetch(SpotifyWebAPI api) public override IList<SpotifyImportListItemInfo> Fetch(SpotifyWebAPI api)
{ {
return Settings.PlaylistIds.SelectMany(x => Fetch(api, x)).ToList(); return Settings.PlaylistIds.SelectMany(x => Fetch(api, x)).ToList();
@ -162,7 +167,7 @@ namespace NzbDrone.Core.ImportLists.Spotify
{ {
id = p.Id, id = p.Id,
name = p.Name name = p.Name
}).Prepend(new { id = LIKEDSONGSID, name = "Liked Songs" }) // TODO : Add Translation }).Prepend(new { id = LIKEDSONGSID, name = _localizationService.GetLocalizedString("LikedSongs") })
} }
}; };
} }

View file

@ -611,6 +611,7 @@
"LidarrSupportsAnyIndexerThatUsesTheNewznabStandardAsWellAsOtherIndexersListedBelow": "{appName} supports any indexer that uses the Newznab standard, as well as other indexers listed below.", "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.", "LidarrSupportsMultipleListsForImportingAlbumsAndArtistsIntoTheDatabase": "{appName} supports multiple lists for importing Albums and Artists into the database.",
"LidarrTags": "{appName} Tags", "LidarrTags": "{appName} Tags",
"LikedSongs": "Liked Songs",
"Links": "Links", "Links": "Links",
"ListRefreshInterval": "List Refresh Interval", "ListRefreshInterval": "List Refresh Interval",
"ListWillRefreshEveryInterp": "List will refresh every {0}", "ListWillRefreshEveryInterp": "List will refresh every {0}",