Skip to content

Commit

Permalink
Fix files with CRLF line endings in translations (#8280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekdohibs authored and paramat committed Feb 23, 2019
1 parent 1942660 commit eeb6762
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/translation.cpp
Expand Up @@ -58,6 +58,10 @@ void Translations::loadTranslation(const std::string &data)

while (is.good()) {
std::getline(is, line);
// Trim last character if file was using a \r\n line ending
if (line.length () > 0 && line[line.length() - 1] == '\r')
line.resize(line.length() - 1);

if (str_starts_with(line, "# textdomain:")) {
textdomain = utf8_to_wide(trim(str_split(line, ':')[1]));
}
Expand Down

0 comments on commit eeb6762

Please sign in to comment.