ShowHelp Localisation Question  
Author Message

PostPosted: .NET Base Class Library, ShowHelp Localisation Question Top

I have finished my windows form application, globalised and localised. That all works fine, but I have one remaining niggle. The main form has a HelpButton linked to the following Method:

private void frmMain_HelpButtonClicked(object sender, CancelEventArgs e)
Help.ShowHelp(this, Properties.Settings.Default.HelpFile);

The value in the application settings for HelpFile is something like 'applicationname.chm' and will be delivered by the setup (MSI) project associated with the solution and placed in the application folder. I have a Spanish version of the helpfile but dont know how to connect it to localised version.

How can I make improve the method to pick up a localised helpfile (e.g perhaps held in the localised content folder)

Bearing in mind that the app will be expanded for other cultures over time, I want a robust and consistent method for selecting the correpsonding helpfile.chm to match my Thread.CurrentThread.CurrentCulture.Name

.NET Development7  

PostPosted: .NET Base Class Library, ShowHelp Localisation Question Top

Instead of putting the path of resource file in Client Settings put this in Localised versions of Assembly Resource Files with the same name:

Like on in Resources.resx put HelpFilePath = "ggg.chm"

Create a Localized Resource and put the HelpFilePath = "sss.chm"

Now use:

Help.ShowHelp(this, Properties.Resources.HelpFilePath);

So whatever culture is underlying, It'll use the localised version of resource file to get path without making Extra Checks!

I hope this will work!

Best Regards,