From b70c65eba69c18b33cd6206fab376511a1047db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Wed, 15 Jan 2025 17:33:33 +0100 Subject: [PATCH] Crowdin: detect string-based projects and fail The API used by Poedit only supports file-based projects and so Poedit can't be used with string-based projects. Detect this situation and show a human-understandable error instead of previously occuring cryptic 404 Not Found. --- src/crowdin_client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/crowdin_client.cpp b/src/crowdin_client.cpp index 2f937d0368..308504c079 100644 --- a/src/crowdin_client.cpp +++ b/src/crowdin_client.cpp @@ -336,6 +336,12 @@ dispatch::future CrowdinClient::GetProjectDetails // Handle project info const json& d = r["data"]; + if (get_value(d, "type", 0) != 0) + { + // TRANSLATORS: Crowdin has string-based and file-based project kinds (see https://support.crowdin.com/creating-project/#file-based-project) + throw Exception(_("String-based Crowdin projects are not supported.")); + } + if (get_value(d, "publicDownloads", false) == false) throw Exception(_("Downloading translations is disabled in this project."));