5#ifndef BITCOIN_UTIL_TRANSLATION_H
6#define BITCOIN_UTIL_TRANSLATION_H
71template <
unsigned num_params>
86template <
typename... Args>
89 const auto original_arg{[](
const auto& arg) ->
const auto& {
90 if constexpr (std::is_same_v<
decltype(arg),
const bilingual_str&>) {
98 const auto translated_arg{[](
const auto& arg) ->
const auto& {
99 if constexpr (std::is_same_v<
decltype(arg),
const bilingual_str&>) {
100 return arg.translated;
#define T(expected, seed, data)
std::ostream & operator<<(std::ostream &os, const TranslatedLiteral &lit)
T operator+(const T &lhs, const TranslatedLiteral &rhs)
bilingual_str & operator+=(const bilingual_str &rhs)
consteval BilingualFmt(TranslatedLiteral l)
const ConstevalFormatString< num_params > original
Compile-time literal string that can be translated with an optional translation function.
const TranslateFn * translate_fn
consteval TranslatedLiteral(const char *str, const TranslateFn *fn=&G_TRANSLATION_FUN)
const char *const original
consteval auto _(util::TranslatedLiteral str)
std::function< std::string(const char *)> TranslateFn
Translate a message to the native language of the user.
const TranslateFn G_TRANSLATION_FUN
Translate string to current locale using Qt.
bilingual_str operator+(bilingual_str lhs, const bilingual_str &rhs)
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.