selecting a language (not the OS language) has no effect

Found a bug or something that needs fixing?
Post Reply
dilosec
Posts: 19
Joined: Sun Jan 31, 2016 5:33 am

selecting a language (not the OS language) has no effect

Post by dilosec »

A recent change, committed Feb 11, 2016: 'Moved language initialization code', has introduced an interesting problem: in 'Options...', selecting a language (that is not the OS installed language, or English) has no effect.

This is because variable m_Language is undefined (as value is not set from Settings) before the SetLanguageModule() call, resulting in the OS installed language (or the English in Explorer++.exe) to be used.

E.g. Explorer++ built from recent github source, run in English region (US, UK, AU, etc.), select French - does not get loaded even when FR dll exists - 'Explorer++.exe -l FR' works fine.
David Erceg
Site Admin
Posts: 933
Joined: Sat Apr 18, 2009 1:46 am

Re: selecting a language (not the OS language) has no effect

Post by David Erceg »

That doesn't entirely surprise me :( It's somewhat difficult to sort out which order parts of the initialization code need to run in. Hopefully the fix shouldn't be too hard, I think the language initialization call can just be done directly after LoadAllSettings().
dilosec
Posts: 19
Joined: Sun Jan 31, 2016 5:33 am

Re: selecting a language (not the OS language) has no effect

Post by dilosec »

Moving the SetLanguageModule and GetDefaultColorRules calls to Initialization.cpp has fixed this problem for me.
dilosec
Posts: 19
Joined: Sun Jan 31, 2016 5:33 am

Re: selecting a language (not the OS language) has no effect

Post by dilosec »

dilosec wrote:Moving the SetLanguageModule and GetDefaultColorRules calls to Initialization.cpp has fixed this problem for me.
I found that this did not load my saved <ColorRules> (in config.xml), and these were lost on Settings save when program exits.

I've moved the code back to Explorer++.cpp, and added code pinched from elsewhere to load Settings before SetLanguageModule call.

The solution is not the best, but it works for me - correct loads saved Language translation dll and ColorRules.

Code: Select all

ILoadSave *pLoadSave = NULL;
TestConfigFile();
if(m_bLoadSettingsFromXML)
{
	pLoadSave = new CLoadSaveXML(this,TRUE);
	m_bSavePreferencesToXMLFile = TRUE;
}
else
{
	pLoadSave = new CLoadSaveRegistry(this);
}
pLoadSave->LoadGenericSettings();
delete pLoadSave;

SetLanguageModule();

m_ColorRules = NColorRuleHelper::GetDefaultColorRules(m_hLanguageModule);
Post Reply