Thanks, here is my code snip:

Dim LangDialog
Set langDialog = SharedObjects("com.GWMicro.GWToolkit.SelectLanguage").NewDialog
langDialog.XMLFile = MyXMLFile
dim ChosenLanguage: ChosenLanguage = langDialog.Show
ClientInformation.UILanguage = ChosenLanguage
Set myStrings = Strings( MyXMLFile )
Set LangDialog = Nothing

The above code, produces an error on the ClientInformation line, saying
   invalid procedure call or argument.

Why, and what is it I miss here?

Thanks again,



----- Original Message ----- From: "Stephen Clower" <[email protected]>
To: <[email protected]>
Sent: Thursday, May 24, 2012 9:54 PM
Subject: Re: User User controlled Interface Language


David,

Once you have your chosen language identifier, such as "en" for English, set your ClientInformation.UILanguage property accordingly and reload your XML file; e.g.
ClientInformation.UILanguage = "en"
Set myStrings = Strings("MyStringFile.xml")

HTH,
Steve




On 5/24/2012 3:38 PM, David wrote:
OK, I really could use a bit of help here. I've been scrolling the Scripting manual, and also the manual for the toolkit. I think I am on the right track, but really can't see how to achieve my goal.

First of all, though, let me just point out, there seems to be a typo in the GWToolkit helpfile. Under SelectLanguage, it gives the following example:

Set langDialog = SharedObjects("com.GWMicro.GWToolkit.MessageBox").NewDialog
langDialog.XMLFile = "gwtoolkit.xml"
langDialog.Show

Hmm, shouldn't the "MessageBox" rather be "SelectLanguage"? At least, when I changed it to be, I can get the listbox of available languages to show up. So, my code looks like this:

Set langDialog = SharedObjects("com.GWMicro.GWToolkit.SelectLanguage").NewDialog
langDialog.XMLFile = "MyApp.xml"
langDialog.Show

So far, things look OK. And, if I change the last line to read:
     Speak LangDialog.Show
, it does speak out the chosen language, when I am done with the selection. I.e, it would say "English US".

Good. Now only, is to use this 'result' for something. I then browsed the Scripting manual, and found the
     ClientInformation.UILanguage
instruction. Thinking that I could use that one for something, I tried:
     ClientInformation.UILanguage = LangDialog.Show
, but am met with an error on that line.

So GW, or whoever, what do I do, so as to actually apply the chosen language from the LangDialog.Show instruction, so that this chosen language will become the active UI language for the app?

Thanks for any feedback here. Maybe I am loosing a main point, or could it be that I am totally off-track?




   ----- Original Message -----
   From: David
   To: [email protected]
   Sent: Thursday, May 24, 2012 5:43 PM
   Subject: User User controlled Interface Language


   OK, so the scenario is this:


My app has an XML file. In here, there is an US English section, and a local translation. Later on, we might get more translations added on.

I have currently, set the XML up with a language order - WE,os,en-us - which would be the standard of the app.

What I want, is to offer the end-user a way of choosing his interface language, no matter which localized/international version of the OS or WE he is running. I do understand, I would have to somehow gather the info, as to which languages are available in the XML file. Then, I guess, drop this into a listbox, and let the user make his choice.

   Two questions araise:
1. Exactly what would be the water-proof way of collecting info as to which languages are available? 2. If now, the user chooses a language, is there an instruction I could give to the app, so as to have it change the language for the interface? Or, will I have to write a somehow lengthy routine to modify the XML file, to accomplish such user controlled language switching?

   Thanks for your advice!



--
Stephen Clower
Product support specialist & App Development
GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com


Reply via email to