Fix translations for Tribler.

This commit is contained in:
Jesper Utoft 2024-08-13 19:44:23 +02:00
parent 9e0d39b247
commit d646af2f88
3 changed files with 8 additions and 10 deletions

View File

@ -302,16 +302,13 @@ namespace NzbDrone.Core.Download.Clients.Tribler
{ {
_logger.Error(ex, ex.Message); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("ApiKey", "Authentication failure") return new ValidationFailure("APIKey", _localizationService.GetLocalizedString("DownloadClientValidationApiKeyIncorrect"));
{
DetailedDescription = string.Format("Please verify your ApiKey is correct. Also verify if the host running Sonarr isn't blocked from accessing {0} by WhiteList limitations in the {0} configuration.", Name)
};
} }
catch (DownloadClientUnavailableException ex) catch (DownloadClientUnavailableException ex)
{ {
_logger.Error(ex, ex.Message); _logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Url", "Unable to connect to Tribler") return new NzbDroneValidationFailure("Host", _localizationService.GetLocalizedString("DownloadClientValidationUnableToConnect", new Dictionary<string, object> { { "clientName", Name } }))
{ {
DetailedDescription = ex.Message DetailedDescription = ex.Message
}; };
@ -320,7 +317,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
{ {
_logger.Error(ex, "Failed to test"); _logger.Error(ex, "Failed to test");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); return new NzbDroneValidationFailure(string.Empty, _localizationService.GetLocalizedString("DownloadClientValidationUnknownException", new Dictionary<string, object> { { "exception", ex.Message } }));
} }
} }
} }

View File

@ -24,7 +24,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
.When(c => c.TvDirectory.IsNotNullOrWhiteSpace()) .When(c => c.TvDirectory.IsNotNullOrWhiteSpace())
.WithMessage("Cannot use Category and Directory"); .WithMessage("Cannot use Category and Directory");
RuleFor(c => c.AnonymityLevel).GreaterThanOrEqualTo(0).WithMessage("Should be greater than or equal to zero"); RuleFor(c => c.AnonymityLevel).GreaterThanOrEqualTo(0);
} }
} }
@ -67,6 +67,7 @@ namespace NzbDrone.Core.Download.Clients.Tribler
public string TvDirectory { get; set; } public string TvDirectory { get; set; }
[FieldDefinition(8, Label = "DownloadClientTriblerSettingsAnonymityLevel", Type = FieldType.Number, HelpText = "DownloadClientTriblerSettingsAnonymityLevelHelpText")] [FieldDefinition(8, Label = "DownloadClientTriblerSettingsAnonymityLevel", Type = FieldType.Number, HelpText = "DownloadClientTriblerSettingsAnonymityLevelHelpText")]
[FieldToken(TokenField.HelpText, "DownloadClientTriblerSettingsAnonymityLevel", "url", "https://www.tribler.org/anonymity.html")]
public int AnonymityLevel { get; set; } public int AnonymityLevel { get; set; }
[FieldDefinition(9, Label = "DownloadClientTriblerSettingsSafeSeeding", Type = FieldType.Checkbox, HelpText = "DownloadClientTriblerSettingsSafeSeedingHelpText")] [FieldDefinition(9, Label = "DownloadClientTriblerSettingsSafeSeeding", Type = FieldType.Checkbox, HelpText = "DownloadClientTriblerSettingsSafeSeedingHelpText")]

View File

@ -535,11 +535,11 @@
"DownloadClientTransmissionSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Transmission location", "DownloadClientTransmissionSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Transmission location",
"DownloadClientTransmissionSettingsUrlBaseHelpText": "Adds a prefix to the {clientName} rpc url, eg {url}, defaults to '{defaultUrl}'", "DownloadClientTransmissionSettingsUrlBaseHelpText": "Adds a prefix to the {clientName} rpc url, eg {url}, defaults to '{defaultUrl}'",
"DownloadClientTriblerSettingsAnonymityLevel": "Anonymity level", "DownloadClientTriblerSettingsAnonymityLevel": "Anonymity level",
"DownloadClientTriblerSettingsAnonymityLevelHelpText": "Number of proxies to use when downloading content. To disable set to 0. Proxies reduce download/upload speed. See https://www.tribler.org/anonymity.html", "DownloadClientTriblerSettingsAnonymityLevelHelpText": "Number of proxies to use when downloading content. To disable set to 0. Proxies reduce download/upload speed. See {url}",
"DownloadClientTriblerSettingsApiKeyHelpText": "Api key, found in %APPDATA%\\Roaming\\.Tribler\\7.14\\triblerd.conf, the api key is [api].key, NOT [http_api].key", "DownloadClientTriblerSettingsApiKeyHelpText": "[api].key from triblerd.conf",
"DownloadClientTriblerSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Tribler location", "DownloadClientTriblerSettingsDirectoryHelpText": "Optional location to put downloads in, leave blank to use the default Tribler location",
"DownloadClientTriblerSettingsSafeSeeding": "Safe Seeding", "DownloadClientTriblerSettingsSafeSeeding": "Safe Seeding",
"DownloadClientTriblerSettingsSafeSeedingHelpText": "If seeding only should be done through proxies. The Anonymity level defines the number of proxies used. See https://www.tribler.org/anonymity.html", "DownloadClientTriblerSettingsSafeSeedingHelpText": "Only Seed through proxies.",
"DownloadClientUTorrentTorrentStateError": "uTorrent is reporting an error", "DownloadClientUTorrentTorrentStateError": "uTorrent is reporting an error",
"DownloadClientValidationApiKeyIncorrect": "API Key Incorrect", "DownloadClientValidationApiKeyIncorrect": "API Key Incorrect",
"DownloadClientValidationApiKeyRequired": "API Key Required", "DownloadClientValidationApiKeyRequired": "API Key Required",