Skip to content

Commit

Permalink
move translate_string definition back to cpp file, to not include tra…
Browse files Browse the repository at this point in the history
…nslations.h in strings.h
  • Loading branch information
Desour committed Oct 16, 2024
1 parent fad1470 commit 54402ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/util/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,11 @@ std::wstring translate_string(std::wstring_view s, Translations *translations)
return res;
}

std::wstring translate_string(std::wstring_view s)
{
return translate_string(s, g_client_translations);
}

static const std::array<std::wstring_view, 30> disallowed_dir_names = {
// Problematic filenames from here:
// https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#file-and-directory-names
Expand Down
6 changes: 1 addition & 5 deletions src/util/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#if IS_CLIENT_BUILD
#include "irrString.h"
#endif
#include "translation.h"
#include <cstdlib>
#include <string>
#include <string_view>
Expand Down Expand Up @@ -657,10 +656,7 @@ std::vector<std::basic_string<T> > split(const std::basic_string<T> &s, T delim)

std::wstring translate_string(std::wstring_view s, Translations *translations);

inline std::wstring translate_string(std::wstring_view s)
{
return translate_string(s, g_client_translations);
}
std::wstring translate_string(std::wstring_view s);

inline std::wstring unescape_translate(std::wstring_view s)
{
Expand Down

0 comments on commit 54402ab

Please sign in to comment.