diff --git a/ShareX.UploadersLib/FileUploaders/Lambda.cs b/ShareX.UploadersLib/FileUploaders/Lambda.cs index b3a5128d6..6fa9cb8f0 100644 --- a/ShareX.UploadersLib/FileUploaders/Lambda.cs +++ b/ShareX.UploadersLib/FileUploaders/Lambda.cs @@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License #endregion License Information (GPL v3) using Newtonsoft.Json; +using ShareX.UploadersLib.Properties; using System.Collections.Generic; using System.IO; @@ -45,7 +46,7 @@ public override UploadResult Upload(Stream stream, string fileName) { if (string.IsNullOrEmpty(Config.UserAPIKey)) { - Errors.Add("Missing API key. Set one in destination settings."); + Errors.Add(Resources.Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_); return null; } diff --git a/ShareX.UploadersLib/Properties/Resources.Designer.cs b/ShareX.UploadersLib/Properties/Resources.Designer.cs index 7fb53dd3f..8a7e638b3 100644 --- a/ShareX.UploadersLib/Properties/Resources.Designer.cs +++ b/ShareX.UploadersLib/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.0 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -421,6 +421,15 @@ internal static System.Drawing.Icon Lambda { } } + /// + /// Looks up a localized string similar to Missing API key. Set one in destination settings.. + /// + internal static string Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_ { + get { + return ResourceManager.GetString("Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX.UploadersLib/Properties/Resources.resx b/ShareX.UploadersLib/Properties/Resources.resx index c74b573f5..b3992ca03 100644 --- a/ShareX.UploadersLib/Properties/Resources.resx +++ b/ShareX.UploadersLib/Properties/Resources.resx @@ -472,4 +472,7 @@ Created folders: ..\Favicons\hubic.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Missing API key. Set one in destination settings. + \ No newline at end of file diff --git a/ShareX.UploadersLib/UploadersConfig.cs b/ShareX.UploadersLib/UploadersConfig.cs index 132d34422..51ded86b9 100644 --- a/ShareX.UploadersLib/UploadersConfig.cs +++ b/ShareX.UploadersLib/UploadersConfig.cs @@ -414,6 +414,8 @@ public bool IsValid(FileDestination destination) return !string.IsNullOrEmpty(OwnCloudHost) && !string.IsNullOrEmpty(OwnCloudUsername) && !string.IsNullOrEmpty(OwnCloudPassword); case FileDestination.MediaFire: return !string.IsNullOrEmpty(MediaFireUsername) && !string.IsNullOrEmpty(MediaFirePassword); + case FileDestination.Lambda: + return LambdaSettings != null && !string.IsNullOrEmpty(LambdaSettings.UserAPIKey); } return true;