Skip to content

Commit

Permalink
Merge pull request #561 from Wargus/po_english
Browse files Browse the repository at this point in the history
Fix `LoadPO` for English (empty filename).
  • Loading branch information
Jarod42 authored Nov 12, 2023
2 parents 05bbc3b + a793b6d commit 6a17596
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/stratagus/translate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,18 @@ const std::string& Plural(const std::string& str, std::size_t count)
*/
void LoadPO(const fs::path& filename)
{
if (filename.empty()) { // Typically English
return;
}
const fs::path fullfilename = LibraryFileName(filename.string());
DebugPrint(
"LoadPO(\"%s\") -> \"%s\"\n", filename.u8string().c_str(), fullfilename.u8string().c_str());

std::ifstream poFile(fullfilename);
if (!poFile) {
ErrorPrint("Cannot open '%s'\n", fullfilename.u8string().c_str());
return;
}
catalog.Add(poFile);
}

Expand Down

0 comments on commit 6a17596

Please sign in to comment.