mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Rename translation methods to be not one letter.
It fixes several warnings, when the name was shadowed by a local "p".
This commit is contained in:
+27
-26
@@ -60,24 +60,25 @@ class CModInfo;
|
||||
#define ZNC_EXPORT_LIB_EXPORT
|
||||
#endif
|
||||
|
||||
#define MODCOMMONDEFS(CLASS, DESCRIPTION, TYPE) \
|
||||
extern "C" { \
|
||||
ZNC_EXPORT_LIB_EXPORT bool ZNCModInfo(double dCoreVersion, \
|
||||
CModInfo& Info); \
|
||||
ZNC_EXPORT_LIB_EXPORT bool ZNCModInfo(double dCoreVersion, \
|
||||
CModInfo& Info) { \
|
||||
if (dCoreVersion != VERSION) return false; \
|
||||
auto t = [&](const CString& sEnglish, const CString& sContext = "") { \
|
||||
return sEnglish.empty() ? "" : Info.t(sEnglish, sContext); \
|
||||
}; \
|
||||
t(CString()); /* Don't warn about unused t */ \
|
||||
Info.SetDescription(DESCRIPTION); \
|
||||
Info.SetDefaultType(TYPE); \
|
||||
Info.AddType(TYPE); \
|
||||
Info.SetLoader(TModLoad<CLASS>); \
|
||||
TModInfo<CLASS>(Info); \
|
||||
return true; \
|
||||
} \
|
||||
#define MODCOMMONDEFS(CLASS, DESCRIPTION, TYPE) \
|
||||
extern "C" { \
|
||||
ZNC_EXPORT_LIB_EXPORT bool ZNCModInfo(double dCoreVersion, \
|
||||
CModInfo& Info); \
|
||||
ZNC_EXPORT_LIB_EXPORT bool ZNCModInfo(double dCoreVersion, \
|
||||
CModInfo& Info) { \
|
||||
if (dCoreVersion != VERSION) return false; \
|
||||
auto t_s = [&](const CString& sEnglish, \
|
||||
const CString& sContext = "") { \
|
||||
return sEnglish.empty() ? "" : Info.t_s(sEnglish, sContext); \
|
||||
}; \
|
||||
t_s(CString()); /* Don't warn about unused t_s */ \
|
||||
Info.SetDescription(DESCRIPTION); \
|
||||
Info.SetDefaultType(TYPE); \
|
||||
Info.AddType(TYPE); \
|
||||
Info.SetLoader(TModLoad<CLASS>); \
|
||||
TModInfo<CLASS>(Info); \
|
||||
return true; \
|
||||
} \
|
||||
}
|
||||
|
||||
/** Instead of writing a constructor, you should call this macro. It accepts all
|
||||
@@ -280,7 +281,7 @@ class CModInfo {
|
||||
void SetDefaultType(EModuleType eType) { m_eDefaultType = eType; }
|
||||
// !Setters
|
||||
|
||||
CString t(const CString& sEnglish, const CString& sContext = "") const;
|
||||
CString t_s(const CString& sEnglish, const CString& sContext = "") const;
|
||||
|
||||
private:
|
||||
protected:
|
||||
@@ -1301,13 +1302,13 @@ class CModule {
|
||||
|
||||
#ifndef SWIG
|
||||
// Translation
|
||||
CString t(const CString& sEnglish, const CString& sContext = "") const;
|
||||
CInlineFormatMessage f(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
CInlineFormatMessage p(const CString& sEnglish, const CString& sEnglishes,
|
||||
int iNum, const CString& sContext = "") const;
|
||||
CDelayedTranslation d(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
CString t_s(const CString& sEnglish, const CString& sContext = "") const;
|
||||
CInlineFormatMessage t_f(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
CInlineFormatMessage t_p(const CString& sEnglish, const CString& sEnglishes,
|
||||
int iNum, const CString& sContext = "") const;
|
||||
CDelayedTranslation t_d(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@@ -279,13 +279,13 @@ class CSocket : public CZNCSock {
|
||||
|
||||
#ifndef SWIG
|
||||
// Translation. As opposed to CCoreTranslationMixin, this one uses module.mo
|
||||
CString t(const CString& sEnglish, const CString& sContext = "") const;
|
||||
CInlineFormatMessage f(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
CInlineFormatMessage p(const CString& sEnglish, const CString& sEnglishes,
|
||||
int iNum, const CString& sContext) const;
|
||||
CDelayedTranslation d(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
CString t_s(const CString& sEnglish, const CString& sContext = "") const;
|
||||
CInlineFormatMessage t_f(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
CInlineFormatMessage t_p(const CString& sEnglish, const CString& sEnglishes,
|
||||
int iNum, const CString& sContext) const;
|
||||
CDelayedTranslation t_d(const CString& sEnglish,
|
||||
const CString& sContext = "") const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
@@ -78,14 +78,14 @@ class CDelayedTranslation {
|
||||
// CModule defines its own version of these functions.
|
||||
class CCoreTranslationMixin {
|
||||
protected:
|
||||
static CString t(const CString& sEnglish, const CString& sContext = "");
|
||||
static CInlineFormatMessage f(const CString& sEnglish,
|
||||
const CString& sContext = "");
|
||||
static CInlineFormatMessage p(const CString& sEnglish,
|
||||
const CString& sEnglishes, int iNum,
|
||||
const CString& sContext = "");
|
||||
static CDelayedTranslation d(const CString& sEnglish,
|
||||
const CString& sContext = "");
|
||||
static CString t_s(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 = "");
|
||||
static CDelayedTranslation t_d(const CString& sEnglish,
|
||||
const CString& sContext = "");
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user