diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/GenreSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/GenreSpecification.cs index 032813f20..7baab4aac 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/GenreSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/GenreSpecification.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 1; public override string ImplementationName => "Genre"; - [FieldDefinition(1, Label = "Genre(s)", Type = FieldType.Tag)] + [FieldDefinition(1, Label = "AutoTaggingSpecificationGenre", Type = FieldType.Tag)] public IEnumerable Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/OriginalLanguageSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/OriginalLanguageSpecification.cs index 7d725f3a6..4819ce69c 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/OriginalLanguageSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/OriginalLanguageSpecification.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 1; public override string ImplementationName => "Original Language"; - [FieldDefinition(1, Label = "Language", Type = FieldType.Select, SelectOptions = typeof(OriginalLanguageFieldConverter))] + [FieldDefinition(1, Label = "AutoTaggingSpecificationOriginalLanguage", Type = FieldType.Select, SelectOptions = typeof(OriginalLanguageFieldConverter))] public int Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/QualityProfileSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/QualityProfileSpecification.cs index 4ac2ef14b..35f9866c1 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/QualityProfileSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/QualityProfileSpecification.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 1; public override string ImplementationName => "Quality Profile"; - [FieldDefinition(1, Label = "Quality Profile", Type = FieldType.QualityProfile)] + [FieldDefinition(1, Label = "AutoTaggingSpecificationQualityProfile", Type = FieldType.QualityProfile)] public int Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/RootFolderSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/RootFolderSpecification.cs index 07e08290a..720327b55 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/RootFolderSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/RootFolderSpecification.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 1; public override string ImplementationName => "Root Folder"; - [FieldDefinition(1, Label = "Root Folder", Type = FieldType.RootFolder)] + [FieldDefinition(1, Label = "AutoTaggingSpecificationRootFolder", Type = FieldType.RootFolder)] public string Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/SeriesTypeSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/SeriesTypeSpecification.cs index 1116db529..2c6676137 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/SeriesTypeSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/SeriesTypeSpecification.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 2; public override string ImplementationName => "Series Type"; - [FieldDefinition(1, Label = "Series Type", Type = FieldType.Select, SelectOptions = typeof(SeriesTypes))] + [FieldDefinition(1, Label = "AutoTaggingSpecificationSeriesType", Type = FieldType.Select, SelectOptions = typeof(SeriesTypes))] public int Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/StatusSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/StatusSpecification.cs index a77af9f36..454ccf2a2 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/StatusSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/StatusSpecification.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 1; public override string ImplementationName => "Status"; - [FieldDefinition(1, Label = "Status", Type = FieldType.Select, SelectOptions = typeof(SeriesStatusType))] + [FieldDefinition(1, Label = "AutoTaggingSpecificationStatus", Type = FieldType.Select, SelectOptions = typeof(SeriesStatusType))] public int Status { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/AutoTagging/Specifications/YearSpecification.cs b/src/NzbDrone.Core/AutoTagging/Specifications/YearSpecification.cs index f2f97aef5..1f04e65cd 100644 --- a/src/NzbDrone.Core/AutoTagging/Specifications/YearSpecification.cs +++ b/src/NzbDrone.Core/AutoTagging/Specifications/YearSpecification.cs @@ -23,10 +23,10 @@ namespace NzbDrone.Core.AutoTagging.Specifications public override int Order => 1; public override string ImplementationName => "Year"; - [FieldDefinition(1, Label = "Minimum Year", Type = FieldType.Number)] + [FieldDefinition(1, Label = "AutoTaggingSpecificationMinimumYear", Type = FieldType.Number)] public int Min { get; set; } - [FieldDefinition(2, Label = "Maximum Year", Type = FieldType.Number)] + [FieldDefinition(2, Label = "AutoTaggingSpecificationMaximumYear", Type = FieldType.Number)] public int Max { get; set; } protected override bool IsSatisfiedByWithoutNegate(Series series) diff --git a/src/NzbDrone.Core/CustomFormats/Specifications/LanguageSpecification.cs b/src/NzbDrone.Core/CustomFormats/Specifications/LanguageSpecification.cs index 19114cc61..fcd5f5374 100644 --- a/src/NzbDrone.Core/CustomFormats/Specifications/LanguageSpecification.cs +++ b/src/NzbDrone.Core/CustomFormats/Specifications/LanguageSpecification.cs @@ -27,7 +27,7 @@ namespace NzbDrone.Core.CustomFormats public override int Order => 3; public override string ImplementationName => "Language"; - [FieldDefinition(1, Label = "Language", Type = FieldType.Select, SelectOptions = typeof(LanguageFieldConverter))] + [FieldDefinition(1, Label = "CustomFormatsSpecificationLanguage", Type = FieldType.Select, SelectOptions = typeof(LanguageFieldConverter))] public int Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input) diff --git a/src/NzbDrone.Core/CustomFormats/Specifications/RegexSpecificationBase.cs b/src/NzbDrone.Core/CustomFormats/Specifications/RegexSpecificationBase.cs index e548d858f..1c133e383 100644 --- a/src/NzbDrone.Core/CustomFormats/Specifications/RegexSpecificationBase.cs +++ b/src/NzbDrone.Core/CustomFormats/Specifications/RegexSpecificationBase.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.CustomFormats protected Regex _regex; protected string _raw; - [FieldDefinition(1, Label = "Regular Expression", HelpText = "Custom Format RegEx is Case Insensitive")] + [FieldDefinition(1, Label = "CustomFormatsSpecificationRegularExpression", HelpText = "CustomFormatsSpecificationRegularExpressionHelpText")] public string Value { get => _raw; diff --git a/src/NzbDrone.Core/CustomFormats/Specifications/ResolutionSpecification.cs b/src/NzbDrone.Core/CustomFormats/Specifications/ResolutionSpecification.cs index a49d19327..1eb90b953 100644 --- a/src/NzbDrone.Core/CustomFormats/Specifications/ResolutionSpecification.cs +++ b/src/NzbDrone.Core/CustomFormats/Specifications/ResolutionSpecification.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.CustomFormats public override int Order => 6; public override string ImplementationName => "Resolution"; - [FieldDefinition(1, Label = "Resolution", Type = FieldType.Select, SelectOptions = typeof(Resolution))] + [FieldDefinition(1, Label = "CustomFormatsSpecificationResolution", Type = FieldType.Select, SelectOptions = typeof(Resolution))] public int Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input) diff --git a/src/NzbDrone.Core/CustomFormats/Specifications/SizeSpecification.cs b/src/NzbDrone.Core/CustomFormats/Specifications/SizeSpecification.cs index 257904a30..3a1e404ec 100644 --- a/src/NzbDrone.Core/CustomFormats/Specifications/SizeSpecification.cs +++ b/src/NzbDrone.Core/CustomFormats/Specifications/SizeSpecification.cs @@ -20,10 +20,10 @@ namespace NzbDrone.Core.CustomFormats public override int Order => 8; public override string ImplementationName => "Size"; - [FieldDefinition(1, Label = "Minimum Size", HelpText = "Release must be greater than this size", Unit = "GB", Type = FieldType.Number)] + [FieldDefinition(1, Label = "CustomFormatsSpecificationMinimumSize", HelpText = "CustomFormatsSpecificationMinimumSizeHelpText", Unit = "GB", Type = FieldType.Number)] public double Min { get; set; } - [FieldDefinition(1, Label = "Maximum Size", HelpText = "Release must be less than or equal to this size", Unit = "GB", Type = FieldType.Number)] + [FieldDefinition(1, Label = "CustomFormatsSpecificationMaximumSize", HelpText = "CustomFormatsSpecificationMaximumSizeHelpText", Unit = "GB", Type = FieldType.Number)] public double Max { get; set; } protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input) diff --git a/src/NzbDrone.Core/CustomFormats/Specifications/SourceSpecification.cs b/src/NzbDrone.Core/CustomFormats/Specifications/SourceSpecification.cs index 1c05c00b3..06c78e1ff 100644 --- a/src/NzbDrone.Core/CustomFormats/Specifications/SourceSpecification.cs +++ b/src/NzbDrone.Core/CustomFormats/Specifications/SourceSpecification.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.CustomFormats public override int Order => 5; public override string ImplementationName => "Source"; - [FieldDefinition(1, Label = "Source", Type = FieldType.Select, SelectOptions = typeof(QualitySource))] + [FieldDefinition(1, Label = "CustomFormatsSpecificationSource", Type = FieldType.Select, SelectOptions = typeof(QualitySource))] public int Value { get; set; } protected override bool IsSatisfiedByWithoutNegate(CustomFormatInput input) diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Plex/PlexMetadataSettings.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Plex/PlexMetadataSettings.cs index c2fb1fe80..de94f5153 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Plex/PlexMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Plex/PlexMetadataSettings.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Plex SeriesPlexMatchFile = true; } - [FieldDefinition(0, Label = "Series Plex Match File", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Creates a .plexmatch file in the series folder")] + [FieldDefinition(0, Label = "MetadataPlexSettingsSeriesPlexMatchFile", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataPlexSettingsSeriesPlexMatchFileHelpText")] public bool SeriesPlexMatchFile { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs index 635303916..f612a1a1c 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Roksbox/RoksboxMetadataSettings.cs @@ -21,16 +21,16 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Roksbox EpisodeImages = true; } - [FieldDefinition(0, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")] + [FieldDefinition(0, Label = "MetadataSettingsEpisodeMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")] public bool EpisodeMetadata { get; set; } - [FieldDefinition(1, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Series Title.jpg")] + [FieldDefinition(1, Label = "MetadataSettingsSeriesImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Series Title.jpg")] public bool SeriesImages { get; set; } - [FieldDefinition(2, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season ##.jpg")] + [FieldDefinition(2, Label = "MetadataSettingsSeasonImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season ##.jpg")] public bool SeasonImages { get; set; } - [FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.jpg")] + [FieldDefinition(3, Label = "MetadataSettingsEpisodeImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.jpg")] public bool EpisodeImages { get; set; } public bool IsValid => true; diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs index f1797fbbd..e79ae09b4 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Wdtv/WdtvMetadataSettings.cs @@ -21,16 +21,16 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Wdtv EpisodeImages = true; } - [FieldDefinition(0, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")] + [FieldDefinition(0, Label = "MetadataSettingsEpisodeMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Season##\\filename.xml")] public bool EpisodeMetadata { get; set; } - [FieldDefinition(1, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "folder.jpg")] + [FieldDefinition(1, Label = "MetadataSettingsSeriesImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "folder.jpg")] public bool SeriesImages { get; set; } - [FieldDefinition(2, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\folder.jpg")] + [FieldDefinition(2, Label = "MetadataSettingsSeasonImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\folder.jpg")] public bool SeasonImages { get; set; } - [FieldDefinition(3, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.metathumb")] + [FieldDefinition(3, Label = "MetadataSettingsEpisodeImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Season##\\filename.metathumb")] public bool EpisodeImages { get; set; } public bool IsValid => true; diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs index 12df64d52..312cde16d 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadataSettings.cs @@ -24,28 +24,28 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc EpisodeImages = true; } - [FieldDefinition(0, Label = "Series Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "tvshow.nfo with full series metadata")] + [FieldDefinition(0, Label = "MetadataSettingsSeriesMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataXmbcSettingsSeriesMetadataHelpText")] public bool SeriesMetadata { get; set; } - [FieldDefinition(1, Label = "Series Metadata Episode Guide", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Include JSON formatted episode guide element in tvshow.nfo (Requires 'Series Metadata')", Advanced = true)] + [FieldDefinition(1, Label = "MetadataSettingsSeriesMetadataEpisodeGuide", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataXmbcSettingsSeriesMetadataEpisodeGuideHelpText", Advanced = true)] public bool SeriesMetadataEpisodeGuide { get; set; } - [FieldDefinition(2, Label = "Series Metadata URL", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "Include TheTVDB show URL in tvshow.nfo (can be combined with 'Series Metadata')", Advanced = true)] + [FieldDefinition(2, Label = "MetadataSettingsSeriesMetadataUrl", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = "MetadataXmbcSettingsSeriesMetadataUrlHelpText", Advanced = true)] public bool SeriesMetadataUrl { get; set; } - [FieldDefinition(3, Label = "Episode Metadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = ".nfo")] + [FieldDefinition(3, Label = "MetadataSettingsEpisodeMetadata", Type = FieldType.Checkbox, Section = MetadataSectionType.Metadata, HelpText = ".nfo")] public bool EpisodeMetadata { get; set; } - [FieldDefinition(4, Label = "Episode Metadata Image Thumbs", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "Include image thumb tags in .nfo (Requires 'Episode Metadata')", Advanced = true)] + [FieldDefinition(4, Label = "MetadataSettingsEpisodeMetadataImageThumbs", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "MetadataXmbcSettingsEpisodeMetadataImageThumbsHelpText", Advanced = true)] public bool EpisodeImageThumb { get; set; } - [FieldDefinition(5, Label = "Series Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "fanart.jpg, poster.jpg, banner.jpg")] + [FieldDefinition(5, Label = "MetadataSettingsSeriesImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "fanart.jpg, poster.jpg, banner.jpg")] public bool SeriesImages { get; set; } - [FieldDefinition(6, Label = "Season Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "season##-poster.jpg, season##-banner.jpg, season-specials-poster.jpg, season-specials-banner.jpg")] + [FieldDefinition(6, Label = "MetadataSettingsSeasonImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "season##-poster.jpg, season##-banner.jpg, season-specials-poster.jpg, season-specials-banner.jpg")] public bool SeasonImages { get; set; } - [FieldDefinition(7, Label = "Episode Images", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "-thumb.jpg")] + [FieldDefinition(7, Label = "MetadataSettingsEpisodeImages", Type = FieldType.Checkbox, Section = MetadataSectionType.Image, HelpText = "-thumb.jpg")] public bool EpisodeImages { get; set; } public bool IsValid => true; diff --git a/src/NzbDrone.Core/ImportLists/AniList/AniListImportBase.cs b/src/NzbDrone.Core/ImportLists/AniList/AniListImportBase.cs index 0a80675af..b5818775b 100644 --- a/src/NzbDrone.Core/ImportLists/AniList/AniListImportBase.cs +++ b/src/NzbDrone.Core/ImportLists/AniList/AniListImportBase.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Validation; @@ -28,8 +29,9 @@ namespace NzbDrone.Core.ImportLists.AniList IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { _importListRepository = netImportRepository; } diff --git a/src/NzbDrone.Core/ImportLists/AniList/AniListSettingsBase.cs b/src/NzbDrone.Core/ImportLists/AniList/AniListSettingsBase.cs index dceb6a7d8..208a70bf0 100644 --- a/src/NzbDrone.Core/ImportLists/AniList/AniListSettingsBase.cs +++ b/src/NzbDrone.Core/ImportLists/AniList/AniListSettingsBase.cs @@ -42,16 +42,16 @@ namespace NzbDrone.Core.ImportLists.AniList public string BaseUrl { get; set; } - [FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string AccessToken { get; set; } - [FieldDefinition(0, Label = "Refresh Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsRefreshToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string RefreshToken { get; set; } - [FieldDefinition(0, Label = "Expires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsExpires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public DateTime Expires { get; set; } - [FieldDefinition(99, Label = "Authenticate with AniList", Type = FieldType.OAuth)] + [FieldDefinition(99, Label = "ImportListsAniListSettingsAuthenticateWithAniList", Type = FieldType.OAuth)] public string SignIn { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/AniList/List/AniListImport.cs b/src/NzbDrone.Core/ImportLists/AniList/List/AniListImport.cs index 0dc91e580..ad62eb1a3 100644 --- a/src/NzbDrone.Core/ImportLists/AniList/List/AniListImport.cs +++ b/src/NzbDrone.Core/ImportLists/AniList/List/AniListImport.cs @@ -9,6 +9,7 @@ using NzbDrone.Core.Configuration; using NzbDrone.Core.Http.CloudFlare; using NzbDrone.Core.ImportLists.Exceptions; using NzbDrone.Core.Indexers.Exceptions; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; @@ -21,12 +22,13 @@ namespace NzbDrone.Core.ImportLists.AniList.List IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(netImportRepository, httpClient, importListStatusService, configService, parsingService, logger) + : base(netImportRepository, httpClient, importListStatusService, configService, parsingService, localizationService, logger) { } - public override string Name => "AniList List"; + public override string Name => _localizationService.GetLocalizedString("TypeOfList", new Dictionary { { "typeOfList", "AniList" } }); public override AniListRequestGenerator GetRequestGenerator() { diff --git a/src/NzbDrone.Core/ImportLists/AniList/List/AniListSettings.cs b/src/NzbDrone.Core/ImportLists/AniList/List/AniListSettings.cs index c160892e6..3f6c34b14 100644 --- a/src/NzbDrone.Core/ImportLists/AniList/List/AniListSettings.cs +++ b/src/NzbDrone.Core/ImportLists/AniList/List/AniListSettings.cs @@ -31,40 +31,40 @@ namespace NzbDrone.Core.ImportLists.AniList.List protected override AbstractValidator Validator => new AniListSettingsValidator(); - [FieldDefinition(1, Label = "Username", HelpText = "Username for the List to import from")] + [FieldDefinition(1, Label = "Username", HelpText = "ImportListsAniListSettingsUsernameHelpText")] public string Username { get; set; } - [FieldDefinition(2, Label = "Import Watching", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Currently Watching")] + [FieldDefinition(2, Label = "ImportListsAniListSettingsImportWatching", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportWatchingHelpText")] public bool ImportCurrent { get; set; } - [FieldDefinition(3, Label = "Import Planning", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Planning to Watch")] + [FieldDefinition(3, Label = "ImportListsAniListSettingsImportPlanning", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportPlanningHelpText")] public bool ImportPlanning { get; set; } - [FieldDefinition(4, Label = "Import Completed", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Completed Watching")] + [FieldDefinition(4, Label = "ImportListsAniListSettingsImportCompleted", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportCompletedHelpText")] public bool ImportCompleted { get; set; } - [FieldDefinition(5, Label = "Import Dropped", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Dropped")] + [FieldDefinition(5, Label = "ImportListsAniListSettingsImportDropped", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportDroppedHelpText")] public bool ImportDropped { get; set; } - [FieldDefinition(6, Label = "Import Paused", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: On Hold")] + [FieldDefinition(6, Label = "ImportListsAniListSettingsImportPaused", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportPausedHelpText")] public bool ImportPaused { get; set; } - [FieldDefinition(7, Label = "Import Repeating", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "List: Currently Rewatching")] + [FieldDefinition(7, Label = "ImportListsAniListSettingsImportRepeating", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportRepeatingHelpText")] public bool ImportRepeating { get; set; } - [FieldDefinition(8, Label = "Import Finished", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: All episodes have aired")] + [FieldDefinition(8, Label = "ImportListsAniListSettingsImportFinished", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportFinishedHelpText")] public bool ImportFinished { get; set; } - [FieldDefinition(9, Label = "Import Releasing", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Currently airing new episodes")] + [FieldDefinition(9, Label = "ImportListsAniListSettingsImportReleasing", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportReleasingHelpText")] public bool ImportReleasing { get; set; } - [FieldDefinition(10, Label = "Import Not Yet Released", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Airing has not yet started")] + [FieldDefinition(10, Label = "ImportListsAniListSettingsImportNotYetReleased", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportNotYetReleasedHelpText")] public bool ImportUnreleased { get; set; } - [FieldDefinition(11, Label = "Import Cancelled", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Series is cancelled")] + [FieldDefinition(11, Label = "ImportListsAniListSettingsImportCancelled", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportCancelledHelpText")] public bool ImportCancelled { get; set; } - [FieldDefinition(12, Label = "Import Hiatus", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "Media: Series on Hiatus")] + [FieldDefinition(12, Label = "ImportListsAniListSettingsImportHiatus", Type = FieldType.Checkbox, Section = sectionImport, HelpText = "ImportListsAniListSettingsImportHiatusHelpText")] public bool ImportHiatus { get; set; } } } diff --git a/src/NzbDrone.Core/ImportLists/Custom/CustomImport.cs b/src/NzbDrone.Core/ImportLists/Custom/CustomImport.cs index 29157be63..3d4645c49 100644 --- a/src/NzbDrone.Core/ImportLists/Custom/CustomImport.cs +++ b/src/NzbDrone.Core/ImportLists/Custom/CustomImport.cs @@ -4,6 +4,7 @@ using FluentValidation.Results; using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; @@ -12,7 +13,7 @@ namespace NzbDrone.Core.ImportLists.Custom public class CustomImport : ImportListBase { private readonly ICustomImportProxy _customProxy; - public override string Name => "Custom List"; + public override string Name => _localizationService.GetLocalizedString("ImportListsCustomListSettingsName"); public override TimeSpan MinRefreshInterval => TimeSpan.FromHours(6); @@ -22,8 +23,9 @@ namespace NzbDrone.Core.ImportLists.Custom IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(importListStatusService, configService, parsingService, logger) + : base(importListStatusService, configService, parsingService, localizationService, logger) { _customProxy = customProxy; } diff --git a/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs b/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs index 8b7cfeb67..a47181b1e 100644 --- a/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs +++ b/src/NzbDrone.Core/ImportLists/Custom/CustomImportProxy.cs @@ -10,6 +10,7 @@ using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; +using NzbDrone.Core.Localization; namespace NzbDrone.Core.ImportLists.Custom { @@ -22,11 +23,13 @@ namespace NzbDrone.Core.ImportLists.Custom public class CustomImportProxy : ICustomImportProxy { private readonly IHttpClient _httpClient; + private readonly ILocalizationService _localizationService; private readonly Logger _logger; - public CustomImportProxy(IHttpClient httpClient, Logger logger) + public CustomImportProxy(IHttpClient httpClient, ILocalizationService localizationService, Logger logger) { _httpClient = httpClient; + _localizationService = localizationService; _logger = logger; } @@ -46,16 +49,16 @@ namespace NzbDrone.Core.ImportLists.Custom if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { _logger.Error(ex, "There was an authorization issue. We cannot get the list from the provider."); - return new ValidationFailure("BaseUrl", "It seems we are unauthorized to make this request."); + return new ValidationFailure("BaseUrl", _localizationService.GetLocalizedString("ImportListsCustomListValidationAuthenticationFailure")); } _logger.Error(ex, "Unable to connect to import list."); - return new ValidationFailure("BaseUrl", $"We are unable to make the request to that URL. StatusCode: {ex.Response.StatusCode}"); + return new ValidationFailure("BaseUrl", _localizationService.GetLocalizedString("ImportListsCustomListValidationConnectionError", new Dictionary { { "exceptionStatusCode", ex.Response.StatusCode } })); } catch (Exception ex) { _logger.Error(ex, "Unable to connect to import list."); - return new ValidationFailure(string.Empty, $"Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); + return new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationUnableToConnectException", new Dictionary { { "exceptionMessage", ex.Message } })); } return null; diff --git a/src/NzbDrone.Core/ImportLists/Custom/CustomSettings.cs b/src/NzbDrone.Core/ImportLists/Custom/CustomSettings.cs index e756225ac..ef3e98f76 100644 --- a/src/NzbDrone.Core/ImportLists/Custom/CustomSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Custom/CustomSettings.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.ImportLists.Custom BaseUrl = ""; } - [FieldDefinition(0, Label = "List URL", HelpText = "The URL for the series list")] + [FieldDefinition(0, Label = "ImportListsCustomListSettingsUrl", HelpText = "ImportListsCustomListSettingsUrlHelpText")] public string BaseUrl { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs index 8a19ab64c..25057c2fd 100644 --- a/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs +++ b/src/NzbDrone.Core/ImportLists/HttpImportListBase.cs @@ -10,6 +10,7 @@ using NzbDrone.Core.Configuration; using NzbDrone.Core.Http.CloudFlare; using NzbDrone.Core.ImportLists.Exceptions; using NzbDrone.Core.Indexers.Exceptions; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Validation; @@ -31,8 +32,8 @@ namespace NzbDrone.Core.ImportLists public abstract IImportListRequestGenerator GetRequestGenerator(); public abstract IParseImportListResponse GetParser(); - public HttpImportListBase(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger) - : base(importListStatusService, configService, parsingService, logger) + public HttpImportListBase(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, ILocalizationService localizationService, Logger logger) + : base(importListStatusService, configService, parsingService, localizationService, logger) { _httpClient = httpClient; } diff --git a/src/NzbDrone.Core/ImportLists/Imdb/ImdbListImport.cs b/src/NzbDrone.Core/ImportLists/Imdb/ImdbListImport.cs index bba85c407..67ee51e0a 100644 --- a/src/NzbDrone.Core/ImportLists/Imdb/ImdbListImport.cs +++ b/src/NzbDrone.Core/ImportLists/Imdb/ImdbListImport.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.ThingiProvider; @@ -10,7 +11,7 @@ namespace NzbDrone.Core.ImportLists.Imdb { public class ImdbListImport : HttpImportListBase { - public override string Name => "IMDb Lists"; + public override string Name => _localizationService.GetLocalizedString("TypeOfList", new Dictionary { { "typeOfList", "IMDb" } }); public override ImportListType ListType => ImportListType.Other; public override TimeSpan MinRefreshInterval => TimeSpan.FromHours(12); @@ -19,8 +20,9 @@ namespace NzbDrone.Core.ImportLists.Imdb IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { } diff --git a/src/NzbDrone.Core/ImportLists/Imdb/ImdbListSettings.cs b/src/NzbDrone.Core/ImportLists/Imdb/ImdbListSettings.cs index 29df45aca..50a7934c0 100644 --- a/src/NzbDrone.Core/ImportLists/Imdb/ImdbListSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Imdb/ImdbListSettings.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.ImportLists.Imdb public string BaseUrl { get; set; } - [FieldDefinition(1, Label = "List ID", HelpText = "IMDb list ID (e.g ls12345678)")] + [FieldDefinition(1, Label = "ImportListsImdbSettingsListId", HelpText = "ImportListsImdbSettingsListIdHelpText")] public string ListId { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/ImportListBase.cs b/src/NzbDrone.Core/ImportLists/ImportListBase.cs index a4c2e81f9..5806e3095 100644 --- a/src/NzbDrone.Core/ImportLists/ImportListBase.cs +++ b/src/NzbDrone.Core/ImportLists/ImportListBase.cs @@ -4,6 +4,7 @@ using System.Linq; using FluentValidation.Results; using NLog; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.ThingiProvider; @@ -16,6 +17,7 @@ namespace NzbDrone.Core.ImportLists protected readonly IImportListStatusService _importListStatusService; protected readonly IConfigService _configService; protected readonly IParsingService _parsingService; + protected readonly ILocalizationService _localizationService; protected readonly Logger _logger; public abstract string Name { get; } @@ -24,11 +26,12 @@ namespace NzbDrone.Core.ImportLists public abstract TimeSpan MinRefreshInterval { get; } - public ImportListBase(IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger) + public ImportListBase(IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, ILocalizationService localizationService, Logger logger) { _importListStatusService = importListStatusService; _configService = configService; _parsingService = parsingService; + _localizationService = localizationService; _logger = logger; } @@ -86,7 +89,7 @@ namespace NzbDrone.Core.ImportLists catch (Exception ex) { _logger.Error(ex, "Test aborted due to exception"); - failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message)); + failures.Add(new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationTestFailed", new Dictionary { { "exceptionMessage", ex.Message } }))); } return new ValidationResult(failures); diff --git a/src/NzbDrone.Core/ImportLists/Plex/PlexImport.cs b/src/NzbDrone.Core/ImportLists/Plex/PlexImport.cs index 5edb0fa91..393bdb692 100644 --- a/src/NzbDrone.Core/ImportLists/Plex/PlexImport.cs +++ b/src/NzbDrone.Core/ImportLists/Plex/PlexImport.cs @@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; using NzbDrone.Core.Exceptions; +using NzbDrone.Core.Localization; using NzbDrone.Core.Notifications.Plex.PlexTv; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; @@ -24,13 +25,14 @@ namespace NzbDrone.Core.ImportLists.Plex IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { _plexTvService = plexTvService; } - public override string Name => "Plex Watchlist"; + public override string Name => _localizationService.GetLocalizedString("ImportListsPlexSettingsWatchlistName"); public override int PageSize => 50; public override IList Fetch() diff --git a/src/NzbDrone.Core/ImportLists/Plex/PlexListSettings.cs b/src/NzbDrone.Core/ImportLists/Plex/PlexListSettings.cs index 8d95285e8..0ffbdba2a 100644 --- a/src/NzbDrone.Core/ImportLists/Plex/PlexListSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Plex/PlexListSettings.cs @@ -27,10 +27,10 @@ namespace NzbDrone.Core.ImportLists.Plex public string BaseUrl { get; set; } - [FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string AccessToken { get; set; } - [FieldDefinition(99, Label = "Authenticate with Plex.tv", Type = FieldType.OAuth)] + [FieldDefinition(99, Label = "ImportListsPlexSettingsAuthenticateWithPlex", Type = FieldType.OAuth)] public string SignIn { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImport.cs b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImport.cs index 91a379c54..20bec751f 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImport.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImport.cs @@ -2,13 +2,14 @@ using System; using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; namespace NzbDrone.Core.ImportLists.Rss.Plex { public class PlexRssImport : RssImportBase { - public override string Name => "Plex Watchlist RSS"; + public override string Name => _localizationService.GetLocalizedString("ImportListsPlexSettingsWatchlistRSSName"); public override ImportListType ListType => ImportListType.Plex; public override TimeSpan MinRefreshInterval => TimeSpan.FromHours(6); @@ -16,8 +17,9 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { } diff --git a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportSettings.cs b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportSettings.cs index 941b90a4a..d6d2e1709 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/Plex/PlexRssImportSettings.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.ImportLists.Rss.Plex { private PlexRssImportSettingsValidator Validator => new (); - [FieldDefinition(0, Label = "Url", Type = FieldType.Textbox, HelpLink = "https://app.plex.tv/desktop/#!/settings/watchlist")] + [FieldDefinition(0, Label = "ImportListsSettingsRssUrl", Type = FieldType.Textbox, HelpLink = "https://app.plex.tv/desktop/#!/settings/watchlist")] public override string Url { get; set; } public override NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/Rss/RssImportBase.cs b/src/NzbDrone.Core/ImportLists/Rss/RssImportBase.cs index de3846687..ef6b6a7ef 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/RssImportBase.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/RssImportBase.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; @@ -19,8 +20,9 @@ namespace NzbDrone.Core.ImportLists.Rss IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { } diff --git a/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseSettings.cs b/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseSettings.cs index 32f631676..9df9d4dd0 100644 --- a/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Rss/RssImportBaseSettings.cs @@ -18,7 +18,7 @@ namespace NzbDrone.Core.ImportLists.Rss public string BaseUrl { get; set; } - [FieldDefinition(0, Label = "Url", Type = FieldType.Textbox)] + [FieldDefinition(0, Label = "ImportListsSettingsRssUrl", Type = FieldType.Textbox)] public virtual string Url { get; set; } public virtual NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs b/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs index 6b7ba596e..8592fb1cc 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs @@ -4,6 +4,7 @@ using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Validation; @@ -28,8 +29,9 @@ namespace NzbDrone.Core.ImportLists.Simkl IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { _importListRepository = netImportRepository; } diff --git a/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs b/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs index f77de5665..13deba893 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs @@ -37,19 +37,19 @@ namespace NzbDrone.Core.ImportLists.Simkl public string BaseUrl { get; set; } - [FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string AccessToken { get; set; } - [FieldDefinition(0, Label = "Refresh Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsRefreshToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string RefreshToken { get; set; } - [FieldDefinition(0, Label = "Expires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsExpires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public DateTime Expires { get; set; } - [FieldDefinition(0, Label = "Auth User", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsAuthUser", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string AuthUser { get; set; } - [FieldDefinition(99, Label = "Authenticate with Simkl", Type = FieldType.OAuth)] + [FieldDefinition(99, Label = "ImportListsSimklSettingsAuthenticatewithSimkl", Type = FieldType.OAuth)] public string SignIn { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserImport.cs b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserImport.cs index d7a9f7908..a425c385b 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserImport.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserImport.cs @@ -1,6 +1,7 @@ using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; namespace NzbDrone.Core.ImportLists.Simkl.User @@ -12,12 +13,13 @@ namespace NzbDrone.Core.ImportLists.Simkl.User IImportListStatusService netImportStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger) + : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger) { } - public override string Name => "Simkl User Watchlist"; + public override string Name => _localizationService.GetLocalizedString("ImportListsSimklSettingsName"); public override IImportListRequestGenerator GetRequestGenerator() { diff --git a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserListType.cs b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserListType.cs index e00bc60ac..6da42ccfc 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserListType.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserListType.cs @@ -1,18 +1,18 @@ -using System.Runtime.Serialization; +using NzbDrone.Core.Annotations; namespace NzbDrone.Core.ImportLists.Simkl.User { public enum SimklUserListType { - [EnumMember(Value = "Watching")] + [FieldOption(Label = "ImportListsSimklSettingsUserListTypeWatching")] Watching = 0, - [EnumMember(Value = "Plan To Watch")] + [FieldOption(Label = "ImportListsSimklSettingsUserListTypePlanToWatch")] PlanToWatch = 1, - [EnumMember(Value = "Hold")] + [FieldOption(Label = "ImportListsSimklSettingsUserListTypeHold")] Hold = 2, - [EnumMember(Value = "Completed")] + [FieldOption(Label = "ImportListsSimklSettingsUserListTypeCompleted")] Completed = 3, - [EnumMember(Value = "Dropped")] + [FieldOption(Label = "ImportListsSimklSettingsUserListTypeDropped")] Dropped = 4 } } diff --git a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs index 65f19aa3f..d5342c578 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs @@ -22,10 +22,10 @@ namespace NzbDrone.Core.ImportLists.Simkl.User ShowType = (int)SimklUserShowType.Shows; } - [FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(SimklUserListType), HelpText = "Type of list you're seeking to import from")] + [FieldDefinition(1, Label = "ImportListsSimklSettingsListType", Type = FieldType.Select, SelectOptions = typeof(SimklUserListType), HelpText = "ImportListsSimklSettingsListTypeHelpText")] public int ListType { get; set; } - [FieldDefinition(1, Label = "Show Type", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "Type of show you're seeking to import from")] + [FieldDefinition(1, Label = "ImportListsSimklSettingsShowType", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "ImportListsSimklSettingsShowTypeHelpText")] public int ShowType { get; set; } } } diff --git a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrImport.cs b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrImport.cs index 33d701781..369b10e52 100644 --- a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrImport.cs +++ b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrImport.cs @@ -5,6 +5,7 @@ using FluentValidation.Results; using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Validation; @@ -23,8 +24,9 @@ namespace NzbDrone.Core.ImportLists.Sonarr IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(importListStatusService, configService, parsingService, logger) + : base(importListStatusService, configService, parsingService, localizationService, logger) { _sonarrV3Proxy = sonarrV3Proxy; } diff --git a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrSettings.cs b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrSettings.cs index ced896f8f..8037a4efa 100644 --- a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrSettings.cs @@ -29,22 +29,23 @@ namespace NzbDrone.Core.ImportLists.Sonarr RootFolderPaths = Array.Empty(); } - [FieldDefinition(0, Label = "Full URL", HelpText = "URL, including port, of the Sonarr instance to import from")] + [FieldDefinition(0, Label = "ImportListsSonarrSettingsFullUrl", HelpText = "ImportListsSonarrSettingsFullUrlHelpText")] public string BaseUrl { get; set; } - [FieldDefinition(1, Label = "API Key", HelpText = "Apikey of the Sonarr instance to import from")] + [FieldDefinition(1, Label = "ApiKey", HelpText = "ImportListsSonarrSettingsApiKeyHelpText")] public string ApiKey { get; set; } - [FieldDefinition(2, Type = FieldType.Select, SelectOptionsProviderAction = "getProfiles", Label = "Quality Profiles", HelpText = "Quality Profiles from the source instance to import from")] + [FieldDefinition(2, Type = FieldType.Select, SelectOptionsProviderAction = "getProfiles", Label = "QualityProfiles", HelpText = "ImportListsSonarrSettingsQualityProfilesHelpText")] public IEnumerable ProfileIds { get; set; } + // TODO: Remove this eventually, no translation added as deprecated [FieldDefinition(3, Type = FieldType.Select, SelectOptionsProviderAction = "getLanguageProfiles", Label = "Language Profiles", HelpText = "Language Profiles from the source instance to import from")] public IEnumerable LanguageProfileIds { get; set; } - [FieldDefinition(4, Type = FieldType.Select, SelectOptionsProviderAction = "getTags", Label = "Tags", HelpText = "Tags from the source instance to import from")] + [FieldDefinition(4, Type = FieldType.Select, SelectOptionsProviderAction = "getTags", Label = "Tags", HelpText = "ImportListsSonarrSettingsTagsHelpText")] public IEnumerable TagIds { get; set; } - [FieldDefinition(5, Type = FieldType.Select, SelectOptionsProviderAction = "getRootFolders", Label = "Root Folders", HelpText = "Root Folders from the source instance to import from")] + [FieldDefinition(5, Type = FieldType.Select, SelectOptionsProviderAction = "getRootFolders", Label = "RootFolders", HelpText = "ImportListsSonarrSettingsRootFoldersHelpText")] public IEnumerable RootFolderPaths { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs index 2021304ed..2913dae9b 100644 --- a/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs +++ b/src/NzbDrone.Core/ImportLists/Sonarr/SonarrV3Proxy.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; +using NzbDrone.Core.Localization; namespace NzbDrone.Core.ImportLists.Sonarr { @@ -23,10 +24,12 @@ namespace NzbDrone.Core.ImportLists.Sonarr { private readonly IHttpClient _httpClient; private readonly Logger _logger; + private readonly ILocalizationService _localizationService; - public SonarrV3Proxy(IHttpClient httpClient, Logger logger) + public SonarrV3Proxy(IHttpClient httpClient, ILocalizationService localizationService, Logger logger) { _httpClient = httpClient; + _localizationService = localizationService; _logger = logger; } @@ -66,22 +69,22 @@ namespace NzbDrone.Core.ImportLists.Sonarr if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { _logger.Error(ex, "API Key is invalid"); - return new ValidationFailure("ApiKey", "API Key is invalid"); + return new ValidationFailure("ApiKey", _localizationService.GetLocalizedString("ImportListsValidationInvalidApiKey")); } if (ex.Response.HasHttpRedirect) { _logger.Error(ex, "Sonarr returned redirect and is invalid"); - return new ValidationFailure("BaseUrl", "Sonarr URL is invalid, are you missing a URL base?"); + return new ValidationFailure("BaseUrl", _localizationService.GetLocalizedString("ImportListsSonarrValidationInvalidUrl")); } _logger.Error(ex, "Unable to connect to import list."); - return new ValidationFailure(string.Empty, $"Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); + return new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationUnableToConnectException", new Dictionary { { "exceptionMessage", ex.Message } })); } catch (Exception ex) { _logger.Error(ex, "Unable to connect to import list."); - return new ValidationFailure(string.Empty, $"Unable to connect to import list: {ex.Message}. Check the log surrounding this error for details."); + return new ValidationFailure(string.Empty, _localizationService.GetLocalizedString("ImportListsValidationUnableToConnectException", new Dictionary { { "exceptionMessage", ex.Message } })); } return null; diff --git a/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListImport.cs b/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListImport.cs index 3d67b7ead..a8c577d84 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListImport.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListImport.cs @@ -1,6 +1,8 @@ +using System.Collections.Generic; using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; namespace NzbDrone.Core.ImportLists.Trakt.List @@ -12,12 +14,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.List IImportListStatusService netImportStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger) + : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger) { } - public override string Name => "Trakt List"; + public override string Name => _localizationService.GetLocalizedString("TypeOfList", new Dictionary { { "typeOfList", "Trakt" } }); public override IImportListRequestGenerator GetRequestGenerator() { diff --git a/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs b/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs index 39b1bd6d7..d6fa02405 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/List/TraktListSettings.cs @@ -17,10 +17,10 @@ namespace NzbDrone.Core.ImportLists.Trakt.List { protected override AbstractValidator Validator => new TraktListSettingsValidator(); - [FieldDefinition(1, Label = "Username", HelpText = "Username for the List to import from")] + [FieldDefinition(1, Label = "Username", HelpText = "ImportListsTraktSettingsUsernameHelpText")] public string Username { get; set; } - [FieldDefinition(2, Label = "List Name", HelpText = "List name for import, list must be public or you must have access to the list")] + [FieldDefinition(2, Label = "ImportListsTraktSettingsListName", HelpText = "ImportListsTraktSettingsListNameHelpText")] public string Listname { get; set; } } } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularImport.cs b/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularImport.cs index b31cc8322..960e0c6db 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularImport.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularImport.cs @@ -1,6 +1,7 @@ using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; namespace NzbDrone.Core.ImportLists.Trakt.Popular @@ -12,12 +13,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular IImportListStatusService netImportStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger) + : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger) { } - public override string Name => "Trakt Popular List"; + public override string Name => _localizationService.GetLocalizedString("ImportListsTraktSettingsPopularName"); public override IParseImportListResponse GetParser() { diff --git a/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularListType.cs b/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularListType.cs index 461e986e6..3ce9cf275 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularListType.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularListType.cs @@ -1,31 +1,30 @@ -using System.Runtime.Serialization; +using NzbDrone.Core.Annotations; namespace NzbDrone.Core.ImportLists.Trakt.Popular { public enum TraktPopularListType { - [EnumMember(Value = "Trending Shows")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTrendingShows")] Trending = 0, - [EnumMember(Value = "Popular Shows")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypePopularShows")] Popular = 1, - [EnumMember(Value = "Anticipated Shows")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeAnticipatedShows")] Anticipated = 2, - - [EnumMember(Value = "Top Watched Shows By Week")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopWeekShows")] TopWatchedByWeek = 3, - [EnumMember(Value = "Top Watched Shows By Month")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopMonthShows")] TopWatchedByMonth = 4, - [EnumMember(Value = "Top Watched Shows By Year")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopYearShows")] TopWatchedByYear = 5, - [EnumMember(Value = "Top Watched Shows Of All Time")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeTopAllTimeShows")] TopWatchedByAllTime = 6, - [EnumMember(Value = "Recommended Shows By Week")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedWeekShows")] RecommendedByWeek = 7, - [EnumMember(Value = "Recommended Shows By Month")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedMonthShows")] RecommendedByMonth = 8, - [EnumMember(Value = "Recommended Shows By Year")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedYearShows")] RecommendedByYear = 9, - [EnumMember(Value = "Recommended Shows Of All Time")] + [FieldOption(Label = "ImportListsTraktSettingsPopularListTypeRecommendedAllTimeShows")] RecommendedByAllTime = 10 } } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularSettings.cs b/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularSettings.cs index 24dcc097d..6d2fef5fb 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/Popular/TraktPopularSettings.cs @@ -35,16 +35,16 @@ namespace NzbDrone.Core.ImportLists.Trakt.Popular TraktListType = (int)TraktPopularListType.Popular; } - [FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TraktPopularListType), HelpText = "Type of list you're seeking to import from")] + [FieldDefinition(1, Label = "ImportListsTraktSettingsListType", Type = FieldType.Select, SelectOptions = typeof(TraktPopularListType), HelpText = "ImportListsTraktSettingsListTypeHelpText")] public int TraktListType { get; set; } - [FieldDefinition(2, Label = "Rating", HelpText = "Filter series by rating range (0-100)")] + [FieldDefinition(2, Label = "ImportListsTraktSettingsRating", HelpText = "ImportListsTraktSettingsRatingHelpText")] public string Rating { get; set; } - [FieldDefinition(4, Label = "Genres", HelpText = "Filter series by Trakt Genre Slug (Comma Separated) Only for Popular Lists")] + [FieldDefinition(4, Label = "ImportListsTraktSettingsGenres", HelpText = "ImportListsTraktSettingsGenresHelpText")] public string Genres { get; set; } - [FieldDefinition(5, Label = "Years", HelpText = "Filter series by year or year range")] + [FieldDefinition(5, Label = "ImportListsTraktSettingsYears", HelpText = "ImportListsTraktSettingsYearsHelpText")] public string Years { get; set; } } } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/TraktImportBase.cs b/src/NzbDrone.Core/ImportLists/Trakt/TraktImportBase.cs index 79922f3f4..848fe9553 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/TraktImportBase.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/TraktImportBase.cs @@ -4,6 +4,7 @@ using NLog; using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Validation; @@ -28,8 +29,9 @@ namespace NzbDrone.Core.ImportLists.Trakt IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(httpClient, importListStatusService, configService, parsingService, logger) + : base(httpClient, importListStatusService, configService, parsingService, localizationService, logger) { _importListRepository = netImportRepository; } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs b/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs index 6b7ed65c7..91ebf19be 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/TraktSettingsBase.cs @@ -48,25 +48,25 @@ namespace NzbDrone.Core.ImportLists.Trakt public string BaseUrl { get; set; } - [FieldDefinition(0, Label = "Access Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsAccessToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string AccessToken { get; set; } - [FieldDefinition(0, Label = "Refresh Token", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsRefreshToken", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string RefreshToken { get; set; } - [FieldDefinition(0, Label = "Expires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsExpires", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public DateTime Expires { get; set; } - [FieldDefinition(0, Label = "Auth User", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "ImportListsSettingsAuthUser", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string AuthUser { get; set; } - [FieldDefinition(5, Label = "Limit", HelpText = "Limit the number of series to get")] + [FieldDefinition(5, Label = "ImportListsTraktSettingsLimit", HelpText = "ImportListsTraktSettingsLimitHelpText")] public int Limit { get; set; } - [FieldDefinition(6, Label = "Additional Parameters", HelpText = "Additional Trakt API parameters", Advanced = true)] + [FieldDefinition(6, Label = "ImportListsTraktSettingsAdditionalParameters", HelpText = "ImportListsTraktSettingsAdditionalParametersHelpText", Advanced = true)] public string TraktAdditionalParameters { get; set; } - [FieldDefinition(99, Label = "Authenticate with Trakt", Type = FieldType.OAuth)] + [FieldDefinition(99, Label = "ImportListsTraktSettingsAuthenticateWithTrakt", Type = FieldType.OAuth)] public string SignIn { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserImport.cs b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserImport.cs index 9a826112a..cea9b81b0 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserImport.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserImport.cs @@ -1,6 +1,7 @@ using NLog; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; namespace NzbDrone.Core.ImportLists.Trakt.User @@ -12,12 +13,13 @@ namespace NzbDrone.Core.ImportLists.Trakt.User IImportListStatusService netImportStatusService, IConfigService configService, IParsingService parsingService, + ILocalizationService localizationService, Logger logger) - : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, logger) + : base(netImportRepository, httpClient, netImportStatusService, configService, parsingService, localizationService, logger) { } - public override string Name => "Trakt User"; + public override string Name => _localizationService.GetLocalizedString("ImportListsTraktSettingsUserListName"); public override IParseImportListResponse GetParser() { diff --git a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserListType.cs b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserListType.cs index 8a0720c23..a42eaf01a 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserListType.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserListType.cs @@ -4,11 +4,11 @@ namespace NzbDrone.Core.ImportLists.Trakt.User { public enum TraktUserListType { - [FieldOption(Label = "User Watch List")] + [FieldOption(Label = "ImportListsTraktSettingsUserListTypeWatch")] UserWatchList = 0, - [FieldOption(Label = "User Watched List")] + [FieldOption(Label = "ImportListsTraktSettingsUserListTypeWatched")] UserWatchedList = 1, - [FieldOption(Label = "User Collection List")] + [FieldOption(Label = "ImportListsTraktSettingsUserListTypeCollection")] UserCollectionList = 2 } } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserSettings.cs b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserSettings.cs index f6ccb7a9c..87becf6f0 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserSettings.cs @@ -25,16 +25,16 @@ namespace NzbDrone.Core.ImportLists.Trakt.User TraktWatchSorting = (int)TraktUserWatchSorting.Rank; } - [FieldDefinition(1, Label = "List Type", Type = FieldType.Select, SelectOptions = typeof(TraktUserListType), HelpText = "Type of list you're seeking to import from")] + [FieldDefinition(1, Label = "ImportListsTraktSettingsListType", Type = FieldType.Select, SelectOptions = typeof(TraktUserListType), HelpText = "ImportListsTraktSettingsListTypeHelpText")] public int TraktListType { get; set; } - [FieldDefinition(2, Label = "Watched List Filter", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchedListType), HelpText = "If List Type is Watched. Series do you want to import from")] + [FieldDefinition(2, Label = "ImportListsTraktSettingsWatchedListFilter", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchedListType), HelpText = "ImportListsTraktSettingsWatchedListFilterHelpText")] public int TraktWatchedListType { get; set; } - [FieldDefinition(3, Label = "Watch List Sorting", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchSorting), HelpText = "If List Type is Watch")] + [FieldDefinition(3, Label = "ImportListsTraktSettingsWatchedListSorting", Type = FieldType.Select, SelectOptions = typeof(TraktUserWatchSorting), HelpText = "ImportListsTraktSettingsWatchedListSortingHelpText")] public int TraktWatchSorting { get; set; } - [FieldDefinition(4, Label = "Username", HelpText = "Username for the List to import from (empty to use Auth User)")] + [FieldDefinition(4, Label = "Username", HelpText = "ImportListsTraktSettingsUserListUsernameHelpText")] public string Username { get; set; } } diff --git a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserWatchedListType.cs b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserWatchedListType.cs index 396ce5987..84634d7d1 100644 --- a/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserWatchedListType.cs +++ b/src/NzbDrone.Core/ImportLists/Trakt/User/TraktUserWatchedListType.cs @@ -4,11 +4,11 @@ namespace NzbDrone.Core.ImportLists.Trakt.User { public enum TraktUserWatchedListType { - [FieldOption(Label = "All")] + [FieldOption(Label = "ImportListsTraktSettingsWatchedListTypeAll")] All = 0, - [FieldOption(Label = "In Progress")] + [FieldOption(Label = "ImportListsTraktSettingsWatchedListTypeInProgress")] InProgress = 1, - [FieldOption(Label = "100% Watched")] + [FieldOption(Label = "ImportListsTraktSettingsWatchedListTypeCompleted")] CompletelyWatched = 2 } } diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 13dab7ab6..c437f4973 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -127,6 +127,14 @@ "AutoTaggingLoadError": "Unable to load auto tagging", "AutoTaggingNegateHelpText": "If checked, the auto tagging rule will not apply if this {implementationName} condition matches.", "AutoTaggingRequiredHelpText": "This {implementationName} condition must match for the auto tagging rule to apply. Otherwise a single {implementationName} match is sufficient.", + "AutoTaggingSpecificationGenre": "Genre(s)", + "AutoTaggingSpecificationMaximumYear": "Maximum Year", + "AutoTaggingSpecificationMinimumYear": "Minimum Year", + "AutoTaggingSpecificationOriginalLanguage": "Language", + "AutoTaggingSpecificationQualityProfile": "Quality Profile", + "AutoTaggingSpecificationRootFolder": "Root Folder", + "AutoTaggingSpecificationSeriesType": "Series Type", + "AutoTaggingSpecificationStatus": "Status", "Automatic": "Automatic", "AutomaticAdd": "Automatic Add", "AutomaticSearch": "Automatic Search", @@ -257,6 +265,16 @@ "CustomFormatsLoadError": "Unable to load Custom Formats", "CustomFormatsSettings": "Custom Formats Settings", "CustomFormatsSettingsSummary": "Custom Formats and Settings", + "CustomFormatsSpecificationLanguage": "Language", + "CustomFormatsSpecificationMaximumSize": "Maximum Size", + "CustomFormatsSpecificationMaximumSizeHelpText": "Release must be less than or equal to this size", + "CustomFormatsSpecificationMinimumSize": "Minimum Size", + "CustomFormatsSpecificationMinimumSizeHelpText": "Release must be greater than this size", + "CustomFormatsSpecificationRegularExpression": "Language", + "CustomFormatsSpecificationRegularExpressionHelpText": "Custom Format RegEx is Case Insensitive", + "CustomFormatsSpecificationReleaseGroup": "Release Group", + "CustomFormatsSpecificationResolution": "Resolution", + "CustomFormatsSpecificationSource": "Source", "Cutoff": "Cutoff", "CutoffUnmet": "Cutoff Unmet", "CutoffUnmetLoadError": "Error loading cutoff unmet items", @@ -759,8 +777,108 @@ "ImportListStatusAllUnavailableHealthCheckMessage": "All lists are unavailable due to failures", "ImportListStatusUnavailableHealthCheckMessage": "Lists unavailable due to failures: {importListNames}", "ImportLists": "Import Lists", + "ImportListsAniListSettingsAuthenticateWithAniList": "Authenticate with AniList", + "ImportListsAniListSettingsImportCancelled": "Import Cancelled", + "ImportListsAniListSettingsImportCancelledHelpText": "Media: Series is cancelled", + "ImportListsAniListSettingsImportCompleted": "Import Completed", + "ImportListsAniListSettingsImportCompletedHelpText": "List: Completed Watching", + "ImportListsAniListSettingsImportDropped": "Import Dropped", + "ImportListsAniListSettingsImportDroppedHelpText": "List: Dropped", + "ImportListsAniListSettingsImportFinished": "Import Finished", + "ImportListsAniListSettingsImportFinishedHelpText": "Media: All episodes have aired", + "ImportListsAniListSettingsImportHiatus": "Import Hiatus", + "ImportListsAniListSettingsImportHiatusHelpText": "Media: Series on Hiatus", + "ImportListsAniListSettingsImportNotYetReleased": "Import Not Yet Released", + "ImportListsAniListSettingsImportNotYetReleasedHelpText": "Media: Airing has not yet started", + "ImportListsAniListSettingsImportPaused": "Import Paused", + "ImportListsAniListSettingsImportPausedHelpText": "List: On Hold", + "ImportListsAniListSettingsImportPlanning": "Import Planning", + "ImportListsAniListSettingsImportPlanningHelpText": "List: Planning to Watch", + "ImportListsAniListSettingsImportReleasing": "Import Releasing", + "ImportListsAniListSettingsImportReleasingHelpText": "Media: Currently airing new episodes", + "ImportListsAniListSettingsImportRepeating": "Import Repeating", + "ImportListsAniListSettingsImportRepeatingHelpText": "List: Currently Re-watching", + "ImportListsAniListSettingsImportWatching": "Import Watching", + "ImportListsAniListSettingsImportWatchingHelpText": "List: Currently Watching", + "ImportListsAniListSettingsUsernameHelpText": "Username for the List to import from", + "ImportListsCustomListSettingsName": "Custom List", + "ImportListsCustomListSettingsUrl": "List URL", + "ImportListsCustomListSettingsUrlHelpText": "The URL for the series list", + "ImportListsCustomListValidationAuthenticationFailure": "Authentication Failure", + "ImportListsCustomListValidationConnectionError": "Unable to make the request to that URL. StatusCode: {exceptionStatusCode}", + "ImportListsImdbSettingsListId": "List ID", + "ImportListsImdbSettingsListIdHelpText": "IMDb list ID (e.g ls12345678)", "ImportListsLoadError": "Unable to load Import Lists", + "ImportListsPlexSettingsAuthenticateWithPlex": "Authenticate with Plex.tv", + "ImportListsPlexSettingsWatchlistName": "Plex Watchlist", + "ImportListsPlexSettingsWatchlistRSSName": "Plex Watchlist RSS", + "ImportListsSettingsAccessToken": "Access Token", + "ImportListsSettingsAuthUser": "Auth User", + "ImportListsSettingsExpires": "Expires", + "ImportListsSettingsRefreshToken": "Refresh Token", + "ImportListsSettingsRssUrl": "RSS URL", "ImportListsSettingsSummary": "Import from another {appName} instance or Trakt lists and manage list exclusions", + "ImportListsSimklSettingsAuthenticatewithSimkl": "Authenticate with Simkl", + "ImportListsSimklSettingsListType": "List Type", + "ImportListsSimklSettingsListTypeHelpText": "Type of list you're seeking to import from", + "ImportListsSimklSettingsName": "Simkl User Watchlist", + "ImportListsSimklSettingsShowType": "Show Type", + "ImportListsSimklSettingsShowTypeHelpText": "Type of show you're seeking to import from", + "ImportListsSimklSettingsUserListTypeCompleted": "Completed", + "ImportListsSimklSettingsUserListTypeDropped": "Dropped", + "ImportListsSimklSettingsUserListTypeHold": "Hold", + "ImportListsSimklSettingsUserListTypePlanToWatch": "Plan To Watch", + "ImportListsSimklSettingsUserListTypeWatching": "Watching", + "ImportListsSonarrSettingsApiKeyHelpText": "API Key of the {appName} instance to import from", + "ImportListsSonarrSettingsFullUrl": "Full URL", + "ImportListsSonarrSettingsFullUrlHelpText": "URL, including port, of the {appName} instance to import from", + "ImportListsSonarrSettingsQualityProfilesHelpText": "Quality Profiles from the source instance to import from", + "ImportListsSonarrSettingsRootFoldersHelpText": "Root Folders from the source instance to import from", + "ImportListsSonarrSettingsTagsHelpText": "Tags from the source instance to import from", + "ImportListsSonarrValidationInvalidUrl": "{appName} URL is invalid, are you missing a URL base?", + "ImportListsTraktSettingsAdditionalParameters": "Additional Parameters", + "ImportListsTraktSettingsAdditionalParametersHelpText": "Additional Trakt API parameters", + "ImportListsTraktSettingsAuthenticateWithTrakt": "Authenticate with Trakt", + "ImportListsTraktSettingsGenres": "Genres", + "ImportListsTraktSettingsGenresHelpText": "Filter series by Trakt Genre Slug (Comma Separated) Only for Popular Lists", + "ImportListsTraktSettingsLimit": "Limit", + "ImportListsTraktSettingsLimitHelpText": "Limit the number of series to get", + "ImportListsTraktSettingsListName": "List Name", + "ImportListsTraktSettingsListNameHelpText": "List name for import, list must be public or you must have access to the list", + "ImportListsTraktSettingsListType": "List Type", + "ImportListsTraktSettingsListTypeHelpText": "Type of list you're seeking to import from", + "ImportListsTraktSettingsPopularListTypeAnticipatedShows": "Anticipated Shows", + "ImportListsTraktSettingsPopularListTypePopularShows": "Popular Shows", + "ImportListsTraktSettingsPopularListTypeRecommendedAllTimeShows": "Recommended Shows Of All Time", + "ImportListsTraktSettingsPopularListTypeRecommendedMonthShows": "Recommended Shows By Month", + "ImportListsTraktSettingsPopularListTypeRecommendedWeekShows": "Recommended Shows By Week", + "ImportListsTraktSettingsPopularListTypeRecommendedYearShows": "Recommended Shows By Year", + "ImportListsTraktSettingsPopularListTypeTopAllTimeShows": "Top Watched Shows Of All Time", + "ImportListsTraktSettingsPopularListTypeTopMonthShows": "Top Watched Shows By Month", + "ImportListsTraktSettingsPopularListTypeTopWeekShows": "Top Watched Shows By Week", + "ImportListsTraktSettingsPopularListTypeTopYearShows": "Top Watched Shows By Year", + "ImportListsTraktSettingsPopularListTypeTrendingShows": "Trending Shows", + "ImportListsTraktSettingsPopularName": "Trakt Popular List", + "ImportListsTraktSettingsRating": "Rating", + "ImportListsTraktSettingsRatingHelpText": "Filter series by rating range (0-100)", + "ImportListsTraktSettingsUserListName": "Trakt User", + "ImportListsTraktSettingsUserListTypeCollection": "User Collection List", + "ImportListsTraktSettingsUserListTypeWatch": "User Watch List", + "ImportListsTraktSettingsUserListTypeWatched": "User Watched List", + "ImportListsTraktSettingsUserListUsernameHelpText": "Username for the List to import from (leave empty to use Auth User)", + "ImportListsTraktSettingsUsernameHelpText": "Username for the List to import from", + "ImportListsTraktSettingsWatchedListFilter": "Watched List Filter", + "ImportListsTraktSettingsWatchedListFilterHelpText": "If List Type is Watched, select the series type you want to import", + "ImportListsTraktSettingsWatchedListSorting": "Watch List Sorting", + "ImportListsTraktSettingsWatchedListSortingHelpText": "If List Type is Watched, select the order to sort the list", + "ImportListsTraktSettingsWatchedListTypeAll": "All", + "ImportListsTraktSettingsWatchedListTypeCompleted": "100% Watched", + "ImportListsTraktSettingsWatchedListTypeInProgress": "In Progress", + "ImportListsTraktSettingsYears": "Years", + "ImportListsTraktSettingsYearsHelpText": "Filter series by year or year range", + "ImportListsValidationInvalidApiKey": "API Key is invalid", + "ImportListsValidationTestFailed": "Test was aborted due to an error: {exceptionMessage}", + "ImportListsValidationUnableToConnectException": "Unable to connect to import list: {exceptionMessage}. Check the log surrounding this error for details.", "ImportMechanismEnableCompletedDownloadHandlingIfPossibleHealthCheckMessage": "Enable Completed Download Handling if possible", "ImportMechanismEnableCompletedDownloadHandlingIfPossibleMultiComputerHealthCheckMessage": "Enable Completed Download Handling if possible (Multi-Computer unsupported)", "ImportMechanismHandlingDisabledHealthCheckMessage": "Enable Completed Download Handling", @@ -959,12 +1077,26 @@ "Message": "Message", "Metadata": "Metadata", "MetadataLoadError": "Unable to load Metadata", + "MetadataPlexSettingsSeriesPlexMatchFile": "Series Plex Match File", + "MetadataPlexSettingsSeriesPlexMatchFileHelpText": "Creates a .plexmatch file in the series folder", "MetadataProvidedBy": "Metadata is provided by {provider}", "MetadataSettings": "Metadata Settings", + "MetadataSettingsEpisodeImages": "Episode Images", + "MetadataSettingsEpisodeMetadata": "Episode Metadata", + "MetadataSettingsEpisodeMetadataImageThumbs": "Episode Metadata Image Thumbs", + "MetadataSettingsSeasonImages": "Season Images", + "MetadataSettingsSeriesImages": "Series Images", + "MetadataSettingsSeriesMetadata": "Series Metadata", + "MetadataSettingsSeriesMetadataEpisodeGuide": "Series Metadata Episode Guide", + "MetadataSettingsSeriesMetadataUrl": "Series Metadata URL", "MetadataSettingsSeriesSummary": "Create metadata files when episodes are imported or series are refreshed", "MetadataSource": "Metadata Source", "MetadataSourceSettings": "Metadata Source Settings", "MetadataSourceSettingsSeriesSummary": "Information on where {appName} gets series and episode information", + "MetadataXmbcSettingsEpisodeMetadataImageThumbsHelpText": "Include image thumb tags in .nfo (Requires 'Episode Metadata')", + "MetadataXmbcSettingsSeriesMetadataEpisodeGuideHelpText": "Include JSON formatted episode guide element in tvshow.nfo (Requires 'Series Metadata')", + "MetadataXmbcSettingsSeriesMetadataHelpText": "tvshow.nfo with full series metadata", + "MetadataXmbcSettingsSeriesMetadataUrlHelpText": "Include TheTVDB show URL in tvshow.nfo (can be combined with 'Series Metadata')", "MidseasonFinale": "Midseason Finale", "Min": "Min", "MinimumAge": "Minimum Age", diff --git a/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs b/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs index cd088677e..f6fc874f1 100644 --- a/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs +++ b/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs @@ -228,10 +228,15 @@ namespace Sonarr.Http.ClientSchema if (attrib != null) { + var label = attrib.Label.IsNotNullOrWhiteSpace() + ? _localizationService.GetLocalizedString(attrib.Label, + GetTokens(selectOptions, attrib.Label, TokenField.Label)) + : attrib.Label; + return new SelectOption { Value = value, - Name = attrib.Label ?? name, + Name = label ?? name, Order = attrib.Order, Hint = attrib.Hint ?? $"({value})" };