Skip to content

Commit

Permalink
Crowdin: detect string-based projects and fail
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vslavik committed Jan 15, 2025
1 parent 26af321 commit b70c65e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/crowdin_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ dispatch::future<CrowdinClient::ProjectDetails> 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."));

Expand Down

0 comments on commit b70c65e

Please sign in to comment.