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

View File

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