Skip to content

Commit eeb6762

Browse files
Ekdohibsparamat
authored andcommitted
Fix files with CRLF line endings in translations (#8280)
1 parent 1942660 commit eeb6762

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/translation.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ void Translations::loadTranslation(const std::string &data)
5858

5959
while (is.good()) {
6060
std::getline(is, line);
61+
// Trim last character if file was using a \r\n line ending
62+
if (line.length () > 0 && line[line.length() - 1] == '\r')
63+
line.resize(line.length() - 1);
64+
6165
if (str_starts_with(line, "# textdomain:")) {
6266
textdomain = utf8_to_wide(trim(str_split(line, ':')[1]));
6367
}

0 commit comments

Comments
 (0)