From 47d34c43f2adb42338aae1d9d9c0a552ea7e6d84 Mon Sep 17 00:00:00 2001 From: Unreal Karaulov Date: Fri, 1 Dec 2023 18:10:14 +0300 Subject: [PATCH] Fix newlines in Localize function --- .gitignore | 1 + src/util/lang.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 2206d996..65e7a8a4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/src/util/lang.cpp b/src/util/lang.cpp index 854584ec..f64cd4d6 100644 --- a/src/util/lang.cpp +++ b/src/util/lang.cpp @@ -1,6 +1,7 @@ #pragma once #include "lang.h" #include "Settings.h" +#include "util.h" #include INI::File * ft = NULL; @@ -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; }