Localization logic moved from ZRColaApp to wxAppEx.

This commit is contained in:
Simon Rozman 2016-02-05 09:56:11 +01:00
parent ecef7013af
commit 7275cc9ecf
2 changed files with 4 additions and 12 deletions

View File

@ -29,13 +29,8 @@ wxIMPLEMENT_APP(ZRColaApp);
bool ZRColaApp::OnInit() bool ZRColaApp::OnInit()
{ {
if (wxLocale::IsAvailable(wxLANGUAGE_SLOVENIAN)) { if (!wxAppEx::OnInit())
wxString sPath(wxPathOnly(argv[0])); return false;
sPath << wxT("\\..\\locale");
m_locale.AddCatalogLookupPathPrefix(sPath);
wxVERIFY(m_locale.Init(wxLANGUAGE_SLOVENIAN));
wxVERIFY(m_locale.AddCatalog(wxT("ZRCola")));
}
ZRColaFrame *frame = new ZRColaFrame(_("Hello World"), wxPoint(50, 50), wxSize(450, 340)); ZRColaFrame *frame = new ZRColaFrame(_("Hello World"), wxPoint(50, 50), wxSize(450, 340));
frame->Show(true); frame->Show(true);

View File

@ -19,17 +19,14 @@
#pragma once #pragma once
#include <wx/app.h> #include <wxex/appex.h>
/// ///
/// ZRCola application /// ZRCola application
/// ///
class ZRColaApp: public wxApp class ZRColaApp : public wxAppEx
{ {
public: public:
virtual bool OnInit(); virtual bool OnInit();
protected:
wxLocale m_locale;
}; };