Localization settings are read from configuration now
This commit is contained in:
parent
b82e4e9b22
commit
690109c5a6
@ -146,16 +146,17 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxConfig config(wxT(ZRCOLA_CFG_APPLICATION), wxT(ZRCOLA_CFG_VENDOR));
|
||||
|
||||
// Set desired locale.
|
||||
// TODO: Check user language setting and select the language accordingly.
|
||||
wxLocale locale;
|
||||
if (wxLocale::IsAvailable(wxLANGUAGE_SLOVENIAN)) {
|
||||
wxString sPath(wxPathOnly(argv[0]));
|
||||
sPath << wxT("\\..\\locale");
|
||||
{
|
||||
wxString sPath;
|
||||
if (config.Read(wxT("LocalizationRepositoryPath"), &sPath))
|
||||
locale.AddCatalogLookupPathPrefix(sPath);
|
||||
wxVERIFY(locale.Init(wxLANGUAGE_SLOVENIAN));
|
||||
wxVERIFY(locale.AddCatalog(wxT("ZRColaCompile")));
|
||||
}
|
||||
wxVERIFY(locale.Init(config.Read(wxT("Language"), wxLANGUAGE_DEFAULT)));
|
||||
wxVERIFY(locale.AddCatalog(wxT("ZRColaCompile")));
|
||||
|
||||
// Parse command line.
|
||||
static const wxCmdLineEntryDesc cmdLineDesc[] =
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include <wx/app.h>
|
||||
#include <wx/cmdline.h>
|
||||
#include <wx/config.h>
|
||||
#include <wx/intl.h>
|
||||
|
||||
#include <wxex/common.h>
|
||||
|
@ -53,3 +53,9 @@
|
||||
// Replace with new on every version change, regardless how minor it is.
|
||||
//
|
||||
#define ZRCOLA_VERSION_GUID "{F0ECB49B-1EF8-487F-9BE3-B0CC3CADE8AE}"
|
||||
|
||||
//
|
||||
// The product vendor and application name for configuration keeping.
|
||||
//
|
||||
#define ZRCOLA_CFG_VENDOR "Amebis"
|
||||
#define ZRCOLA_CFG_APPLICATION "ZRCola"
|
||||
|
Loading…
x
Reference in New Issue
Block a user