1) use ngettext instead of _N, 2) cleanup of gettext macros definitions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -33,12 +33,11 @@
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// gettext() style macros (notice that xgettext should be invoked with
|
// gettext() style macros (notice that xgettext should be invoked with
|
||||||
// --keyword="_" --keyword="_N:1,2" --keyword="N_" options
|
// --keyword="_" --keyword="ngettext:1,2" options
|
||||||
// to extract the strings from the sources)
|
// to extract the strings from the sources)
|
||||||
#ifndef WXINTL_NO_GETTEXT_MACRO
|
#ifndef WXINTL_NO_GETTEXT_MACRO
|
||||||
#define _(s) wxGetTranslation(_T(s))
|
#define _(s) wxGetTranslation(_T(s))
|
||||||
#define _N(s1, s2, n) wxGetTranslation(_T(s1), _T(s2), n)
|
#define ngettext(s1, s2, n) wxGetTranslation(_T(s1), _T(s2), n)
|
||||||
#define N_(s) _T(s)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// another one which just marks the strings for extraction, but doesn't
|
// another one which just marks the strings for extraction, but doesn't
|
||||||
@@ -557,10 +556,13 @@ inline const wxChar *wxGetTranslation(const wxChar *sz1, const wxChar *sz2,
|
|||||||
|
|
||||||
// the macros should still be defined - otherwise compilation would fail
|
// the macros should still be defined - otherwise compilation would fail
|
||||||
|
|
||||||
#if !defined(WXINTL_NO_GETTEXT_MACRO) && !defined(_)
|
#if !defined(WXINTL_NO_GETTEXT_MACRO)
|
||||||
#define _(s) (_T(s))
|
#if !defined(_)
|
||||||
#define _N(s1, s2, n) ((n) == 1 ? _T(s1) : _T(s2))
|
#define _(s) (_T(s))
|
||||||
#define N_(s) _T(s)
|
#endif
|
||||||
|
#if !defined(ngettext)
|
||||||
|
#define ngettext(s1, s2, n) ((n) == 1 ? _T(s1) : _T(s2))
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define wxTRANSLATE(str) _T(str)
|
#define wxTRANSLATE(str) _T(str)
|
||||||
@@ -573,8 +575,13 @@ inline const wxChar *wxGetTranslation(const wxChar *sz1, const wxChar *sz2,
|
|||||||
|
|
||||||
// define this one just in case it occurs somewhere (instead of preferred
|
// define this one just in case it occurs somewhere (instead of preferred
|
||||||
// wxTRANSLATE) too
|
// wxTRANSLATE) too
|
||||||
#if !defined(WXINTL_NO_GETTEXT_MACRO) && !defined(gettext_noop)
|
#if !defined(WXINTL_NO_GETTEXT_MACRO)
|
||||||
#define gettext_noop(str) _T(str)
|
#if !defined(gettext_noop)
|
||||||
|
#define gettext_noop(str) _T(str)
|
||||||
|
#endif
|
||||||
|
#if !defined(N_)
|
||||||
|
#define N_(s) _T(s)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // _WX_INTL_H_
|
#endif // _WX_INTL_H_
|
||||||
|
Reference in New Issue
Block a user