diff --git a/localization/Czech.json b/localization/Czech.json index 61ff5a9..8901f0a 100644 --- a/localization/Czech.json +++ b/localization/Czech.json @@ -11,6 +11,9 @@ "UploadForm_Info": "Informace o souboru", "UploadForm_Upload": "Nahrát", "UploadForm_Cancel": "Zrušit", + "UploadForm_NoApiKey": "Nepřidali jste API klíč. Jděte to nastavení a přidejte ho.", + "UploadForm_InvalidLength": "Přidali jste API klíč, ale nemá správnou délku. Měl by mít 64 znaků.", + "UploadForm_InvalidKey": "Špatný API klíč", "Message_Idle": "Nic.", "Message_Init": "Inicializace...", "Message_Check": "Kontrola...", diff --git a/localization/English.json b/localization/English.json index 7380548..033b08a 100644 --- a/localization/English.json +++ b/localization/English.json @@ -1,21 +1,24 @@ { - "MainForm_DragFile": "Drag file here", - "MainForm_More": "More", - "SettingsForm_Title": "Settings", - "SettingsForm_General": "General settings", - "SettingsForm_Key": "API key", - "SettingsForm_Get": "Get API key", - "SettingsForm_Language": "Language", - "SettingsForm_Save": "Save", - "SettingsForm_Open": "Open settings file", - "UploadForm_Info": "File information", - "UploadForm_Upload": "Upload", - "UploadForm_Cancel": "Cancel", - "Message_Idle": "Idle.", - "Message_Init": "Initializing...", - "Message_Check": "Checking...", - "Message_Upload": "Uploading...", - "Message_NoLink": "No permalink found in response!", - "Message_NoSettings": "No settings file exists.", - "Message_Saved": "Settings saved." -} + "MainForm_DragFile": "Drag file here", + "MainForm_More": "More", + "SettingsForm_Title": "Settings", + "SettingsForm_General": "General settings", + "SettingsForm_Key": "API key", + "SettingsForm_Get": "Get API key", + "SettingsForm_Language": "Language", + "SettingsForm_Save": "Save", + "SettingsForm_Open": "Open settings file", + "UploadForm_Info": "File information", + "UploadForm_Upload": "Upload", + "UploadForm_Cancel": "Cancel", + "UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.", + "UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.", + "UploadForm_InvalidKey": "Invalid API key", + "Message_Idle": "Idle.", + "Message_Init": "Initializing...", + "Message_Check": "Checking...", + "Message_Upload": "Uploading...", + "Message_NoLink": "No permalink found in response!", + "Message_NoSettings": "No settings file exists.", + "Message_Saved": "Settings saved." +} \ No newline at end of file diff --git a/localization/French.json b/localization/French.json index db6a381..b726bfd 100644 --- a/localization/French.json +++ b/localization/French.json @@ -11,6 +11,9 @@ "UploadForm_Info": "Informations sur le fichier", "UploadForm_Upload": "Mettre en ligne", "UploadForm_Cancel": "Annuler", + "UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.", + "UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.", + "UploadForm_InvalidKey": "Invalid API key", "Message_Idle": "Prêt.", "Message_Init": "Initialisation...", "Message_Check": "Vérification...", diff --git a/localization/German.json b/localization/German.json index 9571684..83790de 100644 --- a/localization/German.json +++ b/localization/German.json @@ -11,6 +11,9 @@ "UploadForm_Info": "Dateiinformationen", "UploadForm_Upload": "Hochladen", "UploadForm_Cancel": "Abbrechen", + "UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.", + "UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.", + "UploadForm_InvalidKey": "Invalid API key", "Message_Idle": "Leerlauf.", "Message_Init": "Initialisieren ...", "Message_Check": "Überprüfen ...", diff --git a/localization/Russian.json b/localization/Russian.json index 6696cd9..b30015e 100644 --- a/localization/Russian.json +++ b/localization/Russian.json @@ -11,6 +11,9 @@ "UploadForm_Info": "Информация о файле", "UploadForm_Upload": "Отправить", "UploadForm_Cancel": "Отмена", + "UploadForm_NoApiKey": "You have not entered an API key. Please go to settings and add one.", + "UploadForm_InvalidLength": "You have entered an API key, but the key does not have valid length. Key should contain 64 characters.", + "UploadForm_InvalidKey": "Invalid API key", "Message_Idle": "Ожидание.", "Message_Init": "Инициализация...", "Message_Check": "Проверка...", diff --git a/uploader/.vs/uploader/v16/.suo b/uploader/.vs/uploader/v16/.suo index b27dece..f2d3185 100644 Binary files a/uploader/.vs/uploader/v16/.suo and b/uploader/.vs/uploader/v16/.suo differ diff --git a/uploader/uploader/LocalizationBase.cs b/uploader/uploader/LocalizationBase.cs index 7b81c6e..75ce5df 100644 --- a/uploader/uploader/LocalizationBase.cs +++ b/uploader/uploader/LocalizationBase.cs @@ -23,6 +23,9 @@ namespace uploader public string UploadForm_Info = "File information"; public string UploadForm_Upload = "Upload"; public string UploadForm_Cancel = "Cancel"; + public string UploadForm_NoApiKey = "You have not entered an API key. Please go to settings and add one."; + public string UploadForm_InvalidLength = "You have entered an API key, but the key does not have valid length. Key should contain 64 characters."; + public string UploadForm_InvalidKey = "Invalid API key"; public string Message_Idle = "Idle."; public string Message_Init = "Initializing..."; diff --git a/uploader/uploader/MainForm.cs b/uploader/uploader/MainForm.cs index 2b47a98..662bfdd 100644 --- a/uploader/uploader/MainForm.cs +++ b/uploader/uploader/MainForm.cs @@ -26,6 +26,7 @@ namespace uploader { // Set working directory to exe location because of language files Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); + //LocalizationHelper.Export(); var settings = Settings.LoadSettings(); if (!string.IsNullOrEmpty(settings.Language)) diff --git a/uploader/uploader/UploadForm.cs b/uploader/uploader/UploadForm.cs index eda5015..236ec77 100644 --- a/uploader/uploader/UploadForm.cs +++ b/uploader/uploader/UploadForm.cs @@ -64,6 +64,18 @@ namespace uploader private void Upload() { + if (string.IsNullOrEmpty(_settings.ApiKey)) + { + MessageBox.Show(LocalizationHelper.Base.UploadForm_NoApiKey, LocalizationHelper.Base.UploadForm_InvalidKey, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (_settings.ApiKey.Length != 64) + { + MessageBox.Show(LocalizationHelper.Base.UploadForm_InvalidLength, LocalizationHelper.Base.UploadForm_InvalidKey, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + ChangeStatus(LocalizationHelper.Base.Message_Init); _client = new RestClient("https://www.virustotal.com"); // TODO: check if file exists diff --git a/uploader/uploader/build/anycpu.zip b/uploader/uploader/build/anycpu.zip deleted file mode 100644 index 80e8479..0000000 Binary files a/uploader/uploader/build/anycpu.zip and /dev/null differ