Add helper function for fmt::format(GetStringT(...

This commit is contained in:
JosJuice
2020-10-14 20:50:38 +02:00
parent d100c1dc37
commit 1084cfec1a
6 changed files with 46 additions and 48 deletions

View File

@ -5,6 +5,9 @@
#pragma once
#include <string>
#include <utility>
#include <fmt/format.h>
namespace Common
{
@ -30,6 +33,13 @@ bool MsgAlert(bool yes_no, MsgType style, const char* format, ...)
#endif
;
void SetEnableAlert(bool enable);
// Like fmt::format, except the string becomes translatable
template <typename... Args>
std::string FmtFormatT(const char* string, Args&&... args)
{
return fmt::format(Common::GetStringT(string), std::forward<Args>(args)...);
}
} // namespace Common
#define SuccessAlert(format, ...) \