projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added wxRICHTEXT_SETSTYLE_RESET SetStyleEx() flag to allow for clearing attributes...
[wxWidgets.git]
/
include
/
wx
/
intl.h
diff --git
a/include/wx/intl.h
b/include/wx/intl.h
index 8a72c6179655dfd2a1c166de0b76e15d62c32c69..471d9ad9bab693c51aa48737108a68fa31313421 100644
(file)
--- a/
include/wx/intl.h
+++ b/
include/wx/intl.h
@@
-1,6
+1,6
@@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/intl.h
/////////////////////////////////////////////////////////////////////////////
// Name: wx/intl.h
-// Purpose: Internationalization and localisation for wxWi
ndow
s
+// Purpose: Internationalization and localisation for wxWi
dget
s
// Author: Vadim Zeitlin
// Modified by: Michael N. Filippov <michael@idisys.iae.nsk.su>
// (2003/09/30 - plural forms support)
// Author: Vadim Zeitlin
// Modified by: Michael N. Filippov <michael@idisys.iae.nsk.su>
// (2003/09/30 - plural forms support)
@@
-13,13
+13,19
@@
#ifndef _WX_INTL_H_
#define _WX_INTL_H_
#ifndef _WX_INTL_H_
#define _WX_INTL_H_
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma interface "intl.h"
-#endif
-
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/defs.h"
#include "wx/string.h"
+// Make wxLayoutDirection enum available without need for wxUSE_INTL so wxWindow, wxApp
+// and other classes are not distrubed by wxUSE_INTL
+
+enum wxLayoutDirection
+{
+ wxLayout_Default,
+ wxLayout_LeftToRight,
+ wxLayout_RightToLeft
+};
+
#if wxUSE_INTL
#include "wx/fontenc.h"
#if wxUSE_INTL
#include "wx/fontenc.h"
@@
-32,11
+38,12
@@
// macros
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
-// gettext() style macros (notice that xgettext should be invoked with
-// --keyword="_" --keyword="wx
GetTranslation
:1,2" options
+// gettext() style macros (notice that xgettext should be invoked with
+// --keyword="_" --keyword="wx
PLURAL
:1,2" options
// to extract the strings from the sources)
#ifndef WXINTL_NO_GETTEXT_MACRO
// to extract the strings from the sources)
#ifndef WXINTL_NO_GETTEXT_MACRO
- #define _(s) wxGetTranslation(_T(s))
+ #define _(s) wxGetTranslation(_T(s))
+ #define wxPLURAL(sing, plur, n) wxGetTranslation(_T(sing), _T(plur), n)
#endif
// another one which just marks the strings for extraction, but doesn't
#endif
// another one which just marks the strings for extraction, but doesn't
@@
-48,8
+55,8
@@
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLocale;
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLocale;
-class WXDLLIMPEXP_BASE wxMsgCatalog;
class WXDLLIMPEXP_BASE wxLanguageInfoArray;
class WXDLLIMPEXP_BASE wxLanguageInfoArray;
+class wxMsgCatalog;
// ============================================================================
// locale support
// ============================================================================
// locale support
@@
-319,6
+326,7
@@
struct WXDLLIMPEXP_BASE wxLanguageInfo
WinSublang;
#endif // __WIN32__
wxString Description; // human-readable name of the language
WinSublang;
#endif // __WIN32__
wxString Description; // human-readable name of the language
+ wxLayoutDirection LayoutDirection;
};
// ----------------------------------------------------------------------------
};
// ----------------------------------------------------------------------------
@@
-378,7
+386,7
@@
public:
const wxChar *szShort = (const wxChar *) NULL, // dir prefix (for msg files)
const wxChar *szLocale = (const wxChar *) NULL, // locale (for setlocale)
bool bLoadDefault = true, // preload wxstd.mo?
const wxChar *szShort = (const wxChar *) NULL, // dir prefix (for msg files)
const wxChar *szLocale = (const wxChar *) NULL, // locale (for setlocale)
bool bLoadDefault = true, // preload wxstd.mo?
- bool bConvertEncoding = false) // convert Win<->Unix if nec
c
essary?
+ bool bConvertEncoding = false) // convert Win<->Unix if necessary?
{
DoCommonInit();
{
DoCommonInit();
@@
-405,9
+413,9
@@
public:
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
// restores old locale
int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING);
// restores old locale
- ~wxLocale();
+
virtual
~wxLocale();
- // Try to get user's (or OS's) prefered language setting.
+ // Try to get user's (or OS's) prefer
r
ed language setting.
// Return wxLANGUAGE_UNKNOWN if language-guessing algorithm failed
static int GetSystemLanguage();
// Return wxLANGUAGE_UNKNOWN if language-guessing algorithm failed
static int GetSystemLanguage();
@@
-455,6
+463,11
@@
public:
//
// Returns 'true' if it was successfully loaded
bool AddCatalog(const wxChar *szDomain);
//
// Returns 'true' if it was successfully loaded
bool AddCatalog(const wxChar *szDomain);
+ bool AddCatalog(const wxChar *szDomain,
+ wxLanguage msgIdLanguage, const wxChar *msgIdCharset);
+
+ // check if the given locale is provided by OS and C run time
+ static bool IsAvailable(int lang);
// check if the given catalog is loaded
bool IsLoaded(const wxChar *szDomain) const;
// check if the given catalog is loaded
bool IsLoaded(const wxChar *szDomain) const;
@@
-491,17
+504,21
@@
public:
//
// domains are searched in the last to first order, i.e. catalogs
// added later override those added before.
//
// domains are searched in the last to first order, i.e. catalogs
// added later override those added before.
- const wxChar *GetString(const wxChar *szOrigString,
-
const wxChar *szDomain = (const wxChar *)
NULL) const;
+
virtual
const wxChar *GetString(const wxChar *szOrigString,
+
const wxChar *szDomain =
NULL) const;
// plural form version of the same:
// plural form version of the same:
- const wxChar *GetString(const wxChar *szOrigString,
- const wxChar *szOrigString2,
- size_t n,
-
const wxChar *szDomain = (const wxChar *)
NULL) const;
+
virtual
const wxChar *GetString(const wxChar *szOrigString,
+
const wxChar *szOrigString2,
+
size_t n,
+
const wxChar *szDomain =
NULL) const;
// Returns the current short name for the locale
const wxString& GetName() const { return m_strShort; }
// Returns the current short name for the locale
const wxString& GetName() const { return m_strShort; }
+ // return the contents of .po file header
+ wxString GetHeaderValue( const wxChar* szHeader,
+ const wxChar* szDomain = NULL ) const;
+
// These two methods are for internal use only. First one creates
// ms_languagesDB if it doesn't already exist, second one destroys
// it.
// These two methods are for internal use only. First one creates
// ms_languagesDB if it doesn't already exist, second one destroys
// it.
@@
-545,20
+562,20
@@
private:
extern WXDLLIMPEXP_BASE wxLocale* wxGetLocale();
// get the translation of the string in the current locale
extern WXDLLIMPEXP_BASE wxLocale* wxGetLocale();
// get the translation of the string in the current locale
-inline const wxChar *wxGetTranslation(const wxChar *sz)
+inline const wxChar *wxGetTranslation(const wxChar *sz
, const wxChar* domain=NULL
)
{
wxLocale *pLoc = wxGetLocale();
if (pLoc)
{
wxLocale *pLoc = wxGetLocale();
if (pLoc)
- return pLoc->GetString(sz);
+ return pLoc->GetString(sz
, domain
);
else
return sz;
}
inline const wxChar *wxGetTranslation(const wxChar *sz1, const wxChar *sz2,
else
return sz;
}
inline const wxChar *wxGetTranslation(const wxChar *sz1, const wxChar *sz2,
- size_t n)
+ size_t n
, const wxChar* domain=NULL
)
{
wxLocale *pLoc = wxGetLocale();
if (pLoc)
{
wxLocale *pLoc = wxGetLocale();
if (pLoc)
- return pLoc->GetString(sz1, sz2, n);
+ return pLoc->GetString(sz1, sz2, n
, domain
);
else
return n == 1 ? sz1 : sz2;
}
else
return n == 1 ? sz1 : sz2;
}
@@
-593,4
+610,3
@@
inline const wxChar *wxGetTranslation(const wxChar *sz1, const wxChar *sz2,
#endif
#endif // _WX_INTL_H_
#endif
#endif // _WX_INTL_H_
-