Changeset View
Changeset View
Standalone View
Standalone View
src/util/translation.h
Show All 29 Lines | |||||
/** 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; | ||||
/** | /** | ||||
* Translation function. | * Translation function. | ||||
* If no translation function is set, simply return the input. | * If no translation function is set, simply return the input. | ||||
*/ | */ | ||||
inline std::string _(const char *psz) { | inline bilingual_str _(const char *psz) { | ||||
return G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz; | return bilingual_str{psz, | ||||
G_TRANSLATION_FUN ? (G_TRANSLATION_FUN)(psz) : psz}; | |||||
} | } | ||||
#endif // BITCOIN_UTIL_TRANSLATION_H | #endif // BITCOIN_UTIL_TRANSLATION_H |