Changeset View
Changeset View
Standalone View
Standalone View
src/util/translation.h
Show All 33 Lines | |||||
/** Mark a bilingual_str as untranslated */ | /** Mark a bilingual_str as untranslated */ | ||||
inline bilingual_str Untranslated(std::string original) { | inline bilingual_str Untranslated(std::string original) { | ||||
return {original, original}; | return {original, original}; | ||||
} | } | ||||
namespace tinyformat { | namespace tinyformat { | ||||
template <typename... Args> | template <typename... Args> | ||||
bilingual_str format(const bilingual_str &fmt, const Args &... args) { | bilingual_str format(const bilingual_str &fmt, const Args &...args) { | ||||
return bilingual_str{format(fmt.original, args...), | return bilingual_str{format(fmt.original, args...), | ||||
format(fmt.translated, args...)}; | format(fmt.translated, args...)}; | ||||
} | } | ||||
} // namespace tinyformat | } // namespace tinyformat | ||||
/** Translate a message to the native language of the user. */ | /** Translate a message to the native language of the user. */ | ||||
const extern std::function<std::string(const char *)> G_TRANSLATION_FUN; | const extern std::function<std::string(const char *)> G_TRANSLATION_FUN; | ||||
Show All 10 Lines |