showMyHelp Language

I’m using AppWrapper to add some help books to my application for MAS, one is in spanish and the other in english.

I understand that the code:

declare function NSClassFromString lib "Foundation" ( className as CFstringRef ) as Ptr declare function sharedApplication lib "AppKit" selector "sharedApplication" ( classRef as Ptr ) as Ptr declare sub showMyHelp lib "AppKit" selector "showHelp:" ( appRef as Ptr, sender as Ptr ) showMyHelp( sharedApplication( NSClassFromString( "NSApplication" ) ), nil )

will show the apropiate help file for the OS language, but How can I force a specific language ?

Thanks.

We are talking about html based data.

Add a flag for es, one for en and let the user choose the language. When the user choose english (since the default is spanish), you set a global boolean to True|False (choose the one you prefer) and always display the selected language depending on the Boolean.

Fake code:

If Spanish Then // Display in Spanish Else // Display in English End If

Emile,

yes, I can set a flag but how I call the help file in spanish or english?, the code only includes parameters for appref but I can’t find any reference to the language.

Both help files are included in the same help book and added with AppWrapper. I need to be able to distinguish one or another on my code.

Thanks.

AFAIK, this is not possible. I can’t find anything like this in the reference: NSHelpManager | Apple Developer Documentation

I believe I will have to include both languages in same file and add an anchor, then I may open the help file at this anchor.

Have tried with 2 files but it doesn’t seems to work, always opens spanish file and doesn’t finds english.

Btw, is there any alternative for help or users manual for the MAS? May be an Htmlviewer opening resources file?

Thanks.

I’ve no idea about, but with Freeway 7 Pro (which is outdated, already), I do create HTML Help files in different languages (each for its own), and add them separately using the AppWrapper functionality. This step works fine.

I think the trick is to find an HTML creator application that compiles appropriate HTML Help files, as Freeway Classic compiled files (for example) didn’t work for this step.

Detlef,

thanks for your answer. It’s not a matter of creating different html files for each language, this is fine and I can add them using AppWrapper.

I asked for a way to specifically open one or another of this help files, both in the main menu (Help … option) or with an icon to open at a specific bookmark. Please notice that users may be from any country and even having a non english / spanish OS they may prefer an english / spanish / whatever help text or at least be able to select the help language (I have already a language selector in the app)

I solved it for now by creating only one help file and including both languages at it with a selector, hope it will be fine for the MAS. This way I make sure the user is able to select the apropiate.

You’re true with this reply. Sounds to be a good idea to let select the language from within. :wink:

I think that you’re going to have to roll your own help viewer, which thankfully isn’t hard. A window with an HTMLViewer will do it. simply point to the language index.html that you want to display.

Is it impossible to save the language preference user defined in a file and read it the next launch ?