Click here to Skip to main content
15,885,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this locale switching problem.
First of all this is my directory structure:

+ Project
--+ locale
-----+ en
--------- Project.mo
-----+ ja
--------- Project.mo
--- application.exe

This is part of my code:

wxConfigBase *cfg = wxConfigBase::Get();
lang = cfg->Read (Locale, lang);
if (lang.CmpNoCase(wxT("ja")) == 0)
{
m_locale.Init (wxLANGUAGE_JAPANESE);
}
else if (lang.CmpNoCase(_("en")) == 0)
{
m_locale.Init (wxLANGUAGE_ENGLISH);
}
m_locale.AddCatalogLookupPathPrefix(wxT("locale"));
m_locale.AddCatalog(wxT("Project"));

The problem is:
If lang is "ja" then this executes "m_locale.Init (wxLANGUAGE_JAPANESE);"
When the AddCatalog function is executed, it fails.
Though the application still operates, but the labels of the application are still english.

I don't understand why AddCatalog fails if language chosen is wxLANGUAGE_JAPANESE.
Posted
Updated 21-Jun-13 20:34pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900