translate wxMessageDialog labels to the language of the current locale (closes #10962)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-05 11:48:01 +00:00
parent 60c4147a07
commit 42c097b83e
3 changed files with 50 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ public:
void OnTest1(wxCommandEvent& event);
void OnTest2(wxCommandEvent& event);
void OnTest3(wxCommandEvent& event);
void OnTestMsgBox(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
@@ -93,7 +94,8 @@ enum
INTERNAT_PLAY,
INTERNAT_TEST_1,
INTERNAT_TEST_2,
INTERNAT_TEST_3
INTERNAT_TEST_3,
INTERNAT_TEST_MSGBOX
};
// language data
@@ -163,6 +165,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(INTERNAT_TEST_1, MyFrame::OnTest1)
EVT_MENU(INTERNAT_TEST_2, MyFrame::OnTest2)
EVT_MENU(INTERNAT_TEST_3, MyFrame::OnTest3)
EVT_MENU(INTERNAT_TEST_MSGBOX, MyFrame::OnTestMsgBox)
END_EVENT_TABLE()
IMPLEMENT_APP(MyApp)
@@ -302,6 +305,8 @@ MyFrame::MyFrame(wxLocale& locale)
test_menu->Append(INTERNAT_TEST_1, _("&1 _() (gettext)"), _("Tests the _() macro"));
test_menu->Append(INTERNAT_TEST_2, _("&2 _N() (ngettext)"), _("Tests the _N() macro"));
test_menu->Append(INTERNAT_TEST_3, _("&3 wxTRANSLATE() (gettext_noop)"), _("Tests the wxTRANSLATE() macro"));
test_menu->Append(INTERNAT_TEST_MSGBOX, _("&Message box test"),
_("Tests message box buttons labels translation"));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, _("&File"));
@@ -498,4 +503,17 @@ void MyFrame::OnTest3(wxCommandEvent& WXUNUSED(event))
wxMessageBox(s);
}
void MyFrame::OnTestMsgBox(wxCommandEvent& WXUNUSED(event))
{
if ( wxMessageBox
(
_("Are the labels of the buttons in this message box "
"translated into the current locale language?"),
_("wxWidgets i18n sample"),
wxYES_NO,
this
) != wxYES )
{
wxMessageBox(_("Please report the details of your platform to us."));
}
}