mirror of
https://github.com/minetest/minetest.git
synced 2024-11-30 11:33:44 +01:00
Fix files with CRLF line endings in translations (#8280)
This commit is contained in:
parent
1942660955
commit
eeb67627ec
@ -58,6 +58,10 @@ void Translations::loadTranslation(const std::string &data)
|
|||||||
|
|
||||||
while (is.good()) {
|
while (is.good()) {
|
||||||
std::getline(is, line);
|
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:")) {
|
if (str_starts_with(line, "# textdomain:")) {
|
||||||
textdomain = utf8_to_wide(trim(str_split(line, ':')[1]));
|
textdomain = utf8_to_wide(trim(str_split(line, ':')[1]));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user