17 #ifndef ZNC_TRANSLATION_H
18 #define ZNC_TRANSLATION_H
21 #include <unordered_map>
49 const std::locale& LoadTranslation(
const CString& sDomain);
51 std::unordered_map<
CString , std::locale>>
54 std::unordered_map<
CString ,
int> m_miReferences;
76 : m_sDomain(sDomain), m_sContext(sContext), m_sEnglish(sEnglish) {}
91 if (m_text.index() == 0) {
92 return std::get<0>(m_text);
94 return std::get<1>(m_text).Resolve();
98 std::variant<CString, CDelayedTranslation> m_text;
109 const CString& sEnglishes,
int iNum,
std::vector< CString > VCString
Definition: ZNCString.h:38
Definition: Translation.h:103
static CString t_s(const CString &sEnglish, const CString &sContext="")
static CDelayedTranslation t_d(const CString &sEnglish, const CString &sContext="")
static CInlineFormatMessage t_f(const CString &sEnglish, const CString &sContext="")
static CInlineFormatMessage t_p(const CString &sEnglish, const CString &sEnglishes, int iNum, const CString &sContext="")
Definition: Translation.h:71
CDelayedTranslation()=default
CDelayedTranslation(const CString &sDomain, const CString &sContext, const CString &sEnglish)
Definition: Translation.h:74
Definition: Translation.h:85
COptionalTranslation(const CDelayedTranslation &dTranslation)
Definition: Translation.h:89
CString Resolve() const
Definition: Translation.h:90
COptionalTranslation(const CString &sText)
Definition: Translation.h:87
COptionalTranslation(const char *s)
Definition: Translation.h:88
String class that is used inside ZNC.
Definition: ZNCString.h:68
Definition: Translation.h:32
void NewReference(const CString &sDomain)
void DelReference(const CString &sDomain)
void PushLanguage(const CString &sLanguage)
static CTranslation & Get()
CString Singular(const CString &sDomain, const CString &sContext, const CString &sEnglish)
CString Plural(const CString &sDomain, const CString &sContext, const CString &sEnglish, const CString &sEnglishes, int iNum)
Definition: Translation.h:57
CLanguageScope(const CString &sLanguage)
Definition: Translation.h:62
~CTranslationDomainRefHolder()
CTranslationDomainRefHolder(const CString &sDomain)
Definition: Translation.h:24
CString sSelfName
Definition: Translation.h:27
static std::map< CString, CTranslationInfo > GetTranslations()