#pragma once

#define TINYFORMAT_USE_VARIADIC_TEMPLATES

#ifdef __GNUC__
// Tinyformat has a number of non-annotated switch fallthrough cases
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif

#include "dependencies/tinyformat/tinyformat.h"

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

#include "library/strings.h"
namespace OpenApoc
{

template <typename... Args> static UString format(const UString &fmt, Args &&... args)
{
	return tfm::format(fmt.cStr(), std::forward<Args>(args)...);
}

UString tr(const UString &str, const UString domain = "ufo_string");

} // namespace OpenApoc

#pragma once

#include "fmt/printf.h"
#include "library/strings.h"

namespace OpenApoc
{

template <typename... Args> static UString format(const UString &fmt, Args &&... args)
{
	return fmt::sprintf(fmt.str(), std::forward<Args>(args)...);
}

UString tr(const UString &str, const UString domain = "ufo_string");

} // namespace OpenApoc

template <> struct fmt::formatter<OpenApoc::UString> : formatter<std::string>
{
	template <typename FormatContext> auto format(const OpenApoc::UString &s, FormatContext &ctx)
	{
		return formatter<std::string>::format(s.str(), ctx);
	}
};

Use fmtlib's sprintf instead of tinyformat
Use fmtlib's sprintf instead of tinyformat

TODO: Move to the indexed formatting strings for fmtlib
