Skip to content

Commit

Permalink
Fix newlines in Localize function
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 1, 2023
1 parent 470c992 commit 47d34c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ vs-project/fmt/fmt.dir/Debug/fmt.vcxproj.FileListAbsolute.txt
vs-project/fmt/fmt.dir/Release/fmt.vcxproj.FileListAbsolute.txt
*.lit
vs-project/Release/newbspguy.zip
vs-project/Release/language.ini
2 changes: 2 additions & 0 deletions src/util/lang.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "lang.h"
#include "Settings.h"
#include "util.h"
#include <fmt/format.h>

INI::File * ft = NULL;
Expand All @@ -19,6 +20,7 @@ std::string get_localized_string(int id)
if (itr == lang_db.end())
{
std::string value = ft->GetSection(g_settings.language)->GetValue(fmt::format("LANG_{:04}",id), fmt::format("LANG_{:04}", id)).AsString();
replaceAll(value, "\\n", "\n");
lang_db[id] = value;
return value;
}
Expand Down

0 comments on commit 47d34c4

Please sign in to comment.