From e91e1e3d5cab263883c1cee1689c898b8f7c4ecd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 15 Sep 2013 00:15:02 +0000 Subject: [PATCH] Use wxGetTranslation() instead of _() in the public headers. This allows the code in them to compile even when WXINTL_NO_GETTEXT_MACRO is defined. Closes #15443. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filename.h | 4 ++-- include/wx/msw/ole/oleutils.h | 2 +- include/wx/prntbase.h | 4 ++-- include/wx/richmsgdlg.h | 4 ++-- include/wx/richtext/richtextbuffer.h | 8 ++++---- include/wx/richtext/richtextimagedlg.h | 2 +- include/wx/richtext/richtextprint.h | 4 ++-- include/wx/richtext/richtextstyledlg.h | 2 +- include/wx/unix/pipe.h | 2 +- include/wx/xtiprop.h | 12 ++++++------ 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/wx/filename.h b/include/wx/filename.h index e3d1df925d..1a16e14050 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -583,12 +583,12 @@ public: // returns the size in a human readable form wxString - GetHumanReadableSize(const wxString& nullsize = _("Not available"), + GetHumanReadableSize(const wxString& nullsize = wxGetTranslation("Not available"), int precision = 1, wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL) const; static wxString GetHumanReadableSize(const wxULongLong& sz, - const wxString& nullsize = _("Not available"), + const wxString& nullsize = wxGetTranslation("Not available"), int precision = 1, wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL); #endif // wxUSE_LONGLONG diff --git a/include/wx/msw/ole/oleutils.h b/include/wx/msw/ole/oleutils.h index 6f4efe5a8c..1c25d36926 100644 --- a/include/wx/msw/ole/oleutils.h +++ b/include/wx/msw/ole/oleutils.h @@ -49,7 +49,7 @@ inline bool wxOleInitialize() // needs non-default mode. if ( hr != RPC_E_CHANGED_MODE && FAILED(hr) ) { - wxLogError(_("Cannot initialize OLE")); + wxLogError(wxGetTranslation("Cannot initialize OLE")); return false; } diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index f2d640f481..a6f22fa098 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -260,7 +260,7 @@ private: class WXDLLIMPEXP_CORE wxPrintout: public wxObject { public: - wxPrintout(const wxString& title = _("Printout")); + wxPrintout(const wxString& title = wxGetTranslation("Printout")); virtual ~wxPrintout(); virtual bool OnBeginDocument(int startPage, int endPage); @@ -392,7 +392,7 @@ class WXDLLIMPEXP_CORE wxPreviewFrame: public wxFrame public: wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, - const wxString& title = _("Print Preview"), + const wxString& title = wxGetTranslation("Print Preview"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT, diff --git a/include/wx/richmsgdlg.h b/include/wx/richmsgdlg.h index 5036897a25..1fbc96428f 100644 --- a/include/wx/richmsgdlg.h +++ b/include/wx/richmsgdlg.h @@ -26,8 +26,8 @@ public: const wxString& caption, long style ) : wxGenericMessageDialog( parent, message, caption, style ), - m_detailsExpanderCollapsedLabel( _("&See details") ), - m_detailsExpanderExpandedLabel( _("&Hide details") ), + m_detailsExpanderCollapsedLabel( wxGetTranslation("&See details") ), + m_detailsExpanderExpandedLabel( wxGetTranslation("&Hide details") ), m_checkBoxValue( false ) { } diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 771802d779..a763461545 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -3520,7 +3520,7 @@ public: virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer); - virtual wxString GetPropertiesMenuLabel() const { return _("&Box"); } + virtual wxString GetPropertiesMenuLabel() const { return wxGetTranslation("&Box"); } // Accessors @@ -4645,7 +4645,7 @@ public: virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer); - virtual wxString GetPropertiesMenuLabel() const { return _("&Picture"); } + virtual wxString GetPropertiesMenuLabel() const { return wxGetTranslation("&Picture"); } virtual bool UsesParagraphAttributes() const { return false; } @@ -5575,7 +5575,7 @@ public: virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer); - virtual wxString GetPropertiesMenuLabel() const { return _("&Cell"); } + virtual wxString GetPropertiesMenuLabel() const { return wxGetTranslation("&Cell"); } // Accessors @@ -5665,7 +5665,7 @@ public: virtual bool EditProperties(wxWindow* parent, wxRichTextBuffer* buffer); - virtual wxString GetPropertiesMenuLabel() const { return _("&Table"); } + virtual wxString GetPropertiesMenuLabel() const { return wxGetTranslation("&Table"); } // Returns true if objects of this class can accept the focus, i.e. a call to SetFocusObject // is possible. For example, containers supporting text, such as a text box object, can accept the focus, diff --git a/include/wx/richtext/richtextimagedlg.h b/include/wx/richtext/richtextimagedlg.h index 3a0b91491f..e7e5bf25fe 100644 --- a/include/wx/richtext/richtextimagedlg.h +++ b/include/wx/richtext/richtextimagedlg.h @@ -36,7 +36,7 @@ class WXDLLIMPEXP_FWD_CORE wxTextCtrl; ////@begin control identifiers #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE _("Object Properties") +#define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_TITLE wxGetTranslation("Object Properties") #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_IDNAME ID_RICHTEXTOBJECTPROPERTIESDIALOG #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTOBJECTPROPERTIESDIALOG_POSITION wxDefaultPosition diff --git a/include/wx/richtext/richtextprint.h b/include/wx/richtext/richtextprint.h index 4fe242e672..5dceccf319 100644 --- a/include/wx/richtext/richtextprint.h +++ b/include/wx/richtext/richtextprint.h @@ -106,7 +106,7 @@ private: class WXDLLIMPEXP_RICHTEXT wxRichTextPrintout : public wxPrintout { public: - wxRichTextPrintout(const wxString& title = _("Printout")); + wxRichTextPrintout(const wxString& title = wxGetTranslation("Printout")); virtual ~wxRichTextPrintout(); /// The buffer to print @@ -160,7 +160,7 @@ private: class WXDLLIMPEXP_RICHTEXT wxRichTextPrinting : public wxObject { public: - wxRichTextPrinting(const wxString& name = _("Printing"), wxWindow *parentWindow = NULL); + wxRichTextPrinting(const wxString& name = wxGetTranslation("Printing"), wxWindow *parentWindow = NULL); virtual ~wxRichTextPrinting(); /// Preview the file or buffer diff --git a/include/wx/richtext/richtextstyledlg.h b/include/wx/richtext/richtextstyledlg.h index 6e9f90cf20..d8bea2630e 100644 --- a/include/wx/richtext/richtextstyledlg.h +++ b/include/wx/richtext/richtextstyledlg.h @@ -44,7 +44,7 @@ class WXDLLIMPEXP_FWD_CORE wxCheckBox; ////@begin control identifiers #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX -#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE _("Style Organiser") +#define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_TITLE wxGetTranslation("Style Organiser") #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_IDNAME ID_RICHTEXTSTYLEORGANISERDIALOG #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTSTYLEORGANISERDIALOG_POSITION wxDefaultPosition diff --git a/include/wx/unix/pipe.h b/include/wx/unix/pipe.h index e8e2d427cb..1bde4228a7 100644 --- a/include/wx/unix/pipe.h +++ b/include/wx/unix/pipe.h @@ -44,7 +44,7 @@ public: { if ( pipe(m_fds) == -1 ) { - wxLogSysError(_("Pipe creation failed")); + wxLogSysError(wxGetTranslation("Pipe creation failed")); return false; } diff --git a/include/wx/xtiprop.h b/include/wx/xtiprop.h index e7357c44d8..18626f2982 100644 --- a/include/wx/xtiprop.h +++ b/include/wx/xtiprop.h @@ -176,7 +176,7 @@ public: if ( m_setter ) m_setter->Set( object, value ); else - wxLogError( _("SetProperty called w/o valid setter") ); + wxLogError( wxGetTranslation("SetProperty called w/o valid setter") ); } // Getting a simple property (non-collection) @@ -185,7 +185,7 @@ public: if ( m_getter ) m_getter->Get( object, result ); else - wxLogError( _("GetProperty called w/o valid getter") ); + wxLogError( wxGetTranslation("GetProperty called w/o valid getter") ); } // Adding an element to a collection property @@ -194,7 +194,7 @@ public: if ( m_adder ) m_adder->Add( object, value ); else - wxLogError( _("AddToPropertyCollection called w/o valid adder") ); + wxLogError( wxGetTranslation("AddToPropertyCollection called w/o valid adder") ); } // Getting a collection property @@ -203,7 +203,7 @@ public: if ( m_collectionGetter ) m_collectionGetter->Get( obj, result); else - wxLogError( _("GetPropertyCollection called w/o valid collection getter") ); + wxLogError( wxGetTranslation("GetPropertyCollection called w/o valid collection getter") ); } virtual bool HasSetter() const { return m_setter != NULL; } @@ -256,14 +256,14 @@ public: virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxAny &WXUNUSED(value)) const { - wxLogError( _("AddToPropertyCollection called on a generic accessor") ); + wxLogError( wxGetTranslation("AddToPropertyCollection called on a generic accessor") ); } // Getting a collection property virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxAnyList &WXUNUSED(result)) const { - wxLogError ( _("GetPropertyCollection called on a generic accessor") ); + wxLogError ( wxGetTranslation("GetPropertyCollection called on a generic accessor") ); } private: -- 2.45.2