Skip to content

Commit

Permalink
Fix lang debug
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 5, 2023
1 parent f76cd17 commit 73f8172
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8162,7 +8162,7 @@ void Gui::drawFaceEditorWidget()

for (int v = 0; v < map->vertCount; v++)
{
if (map->verts[v].z != vec.z && VectorCompare(map->verts[v], vec, verts_merge_epsilon))
if (map->verts[v].z == vec.z && VectorCompare(map->verts[v], vec, verts_merge_epsilon))
{
if (vec != lastvec)
{
Expand Down
30 changes: 18 additions & 12 deletions src/util/lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::string get_localized_string(int id)

return itr->second;
}
return "LANG_ERROR_INDEX";
return "LANG_ERROR_INDEX\n";
}

std::string get_localized_string(const std::string & str_id)
Expand All @@ -62,23 +62,29 @@ std::string get_localized_string(const std::string & str_id)

return itr->second;
}
return "LANG_ERROR_STRING";
return "LANG_ERROR_STRING\n";
}

void set_localize_lang(std::string lang)
{
if (ft != NULL)
{
delete ft;
}
static std::string last_lang = "";

try
if (last_lang != lang)
{
ft = new inih::INIReader(g_config_dir + "language.ini");
}
catch(std::runtime_error runtime)
{
logf("Language parse fatal error: {}", runtime.what());
if (ft != NULL)
{
delete ft;
}

try
{
ft = new inih::INIReader(g_config_dir + "language.ini");
}
catch (std::runtime_error runtime)
{
logf("Language parse from {} fatal error: {}\n", g_config_dir + "language.ini", runtime.what());
}
last_lang = lang;
}
g_settings.language = lang;
lang_db.clear();
Expand Down

0 comments on commit 73f8172

Please sign in to comment.