From d0f83f1d6ced4ffa808b43ec3aceef746e139bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Fri, 15 Sep 2023 17:17:09 +0200 Subject: [PATCH] Fix regression in opening PO files from Crowdin --- src/crowdin_client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/crowdin_client.cpp b/src/crowdin_client.cpp index 38cd48c875..4629154b59 100644 --- a/src/crowdin_client.cpp +++ b/src/crowdin_client.cpp @@ -464,15 +464,15 @@ std::wstring CrowdinClient::CreateLocalFilename(const ProjectInfo& project, cons auto internal = std::static_pointer_cast(file.internal); auto project_id = std::get(project.internalID); auto project_name = project.name; - auto file_title = file.title; + auto file_name = internal->fileName; // sanitize to be safe filenames: std::replace_if(project_name.begin(), project_name.end(), boost::is_any_of("\\/:\"<>|?*"), '_'); - std::replace_if(file_title.begin(), file_title.end(), boost::is_any_of("\\/:\"<>|?*"), '_'); + std::replace_if(file_name.begin(), file_name.end(), boost::is_any_of("\\/:\"<>|?*"), '_'); // NB: sync this with ExtractMetadata() const wxString dir = project_name + " - " + lang.Code(); - wxFileName localFileName(dir + wxString::Format("/Crowdin.%d.%d.%s %s", project_id, internal->id, lang.LanguageTag(), file_title)); + wxFileName localFileName(dir + wxString::Format("/Crowdin.%d.%d.%s %s", project_id, internal->id, lang.LanguageTag(), file_name)); auto ext = localFileName.GetExt().Lower(); if (ext == "po")