<language id="no"> <language id="en-us">
That's it. Now, here is one more thing. Even if I delete the ChooseUILanguage.UseDecimal = True line, the thing still happens, same error pops up. Furthermore, the dialog opens, but there is no entries in the list.Yesterday, with the old GWToolkit, the very same XML did produce two entries in the dialog's list: Norwegian, and English United States.
So, seems to me, something got broken here. With the UseDecimal line deleted, I am back to what I had from before, hence I'd expect it to have produced the same entries, at least in that case. But still, the dialog with the new GWToolkit is without any entries. Did you have success in testing the new version on some XMLs? I haven't tried the approach on any other app, but as I said, running the app like yesterday, still results in an empty list, which was populated yesterday. Strange. Smile.
----- Original Message ----- From: "Aaron Smith" <[email protected]>
To: <[email protected]> Sent: Friday, May 25, 2012 4:02 PM Subject: Re: User User controlled Interface Language
David, What are the language values in your XML? Aaron On 5/25/2012 9:54 AM, David wrote:Thanks Aaron,quick work. Yet, seems to have a bug, or I am doing something wrong. (Maybe it's me, who is the bug? Smile)My code looks like this:Dim ChooseUILanguage: Set ChooseUILanguage = SharedObjects("com.GWMicro.GWToolkit.SelectLanguage").NewDialogChooseUILanguage.XMLFile = MyXMLFile ChooseUILanguage.UseDecimal = True ClientInformation.UILanguage = ChooseUILanguage.Show Set myStrings = Strings( MyXMLFile ) Set ChooseUILanguage = Nothing Running it, I get the following error: An Error Occurred in GW Toolkit 8.4.9 (800A000D) Description: Type mismatch: 'Utilities.ConvertLanguageIDToString'Line: 4178 - dObj.Control("lst_languages").Add parmObj.Languages(keys(i)), Utilities.ConvertStringToLanguageId(Utilities.ConvertLanguageIdToString("&H" & keys(i)))Path: C:\Documents and Settings\Administrator\Application Data\GW Micro\Window-Eyes\users\default\gwtoolkit.vbsSigned: "GW Micro, Inc."Also, If the user click Cancel, which return value will be given, that I can check on the value - or in any other way - only set ClientInforamtion.UILanguage if there was a real choice made.Thanks again, ----- Original Message ----- From: "Aaron Smith" <[email protected]> To: <[email protected]> Sent: Friday, May 25, 2012 3:18 PM Subject: Re: User User controlled Interface LanguageVersion 8.4.9 of the toolkit adds a new property to the SelectLanguage class called UseDecimal. If you set this, you'll get the language ID back instead of the name. In otherwords, if you do something like this:Set l = SharedObjects("com.gwmicro.gwtoolkit.selectlanguage").newdialog l.xmlfile = "blah.xml" print l.show() You might get something back, like "English (United States") If you set the new property to true, like this: Set l = SharedObjects("com.gwmicro.gwtoolkit.selectlanguage").newdialog l.xmlfile = "blah.xml" l.UseDecimal = True print l.show()Then you might get back something like 1033. You can then pass that value to ClientInformation.UILanguage.Aaron On 5/25/2012 8:42 AM, Stephen Clower wrote:David,The line is failing because you must pass a valid locale ID instead of the friendly string representation that is being returned by the toolkit. There isn't a straight-forward way to do this on your end, but we will add a way to retrieve a valid locale from the dialog in an update which will go out shortly.Steve On 5/24/2012 6:47 PM, David wrote: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 = NothingThe above code, produces an error on the ClientInformation line, sayinginvalid 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 LanguageDavid, 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 typoin the GWToolkit helpfile. Under SelectLanguage, it gives the following example: Set langDialog = SharedObjects("com.GWMicro.GWToolkit.MessageBox").NewDialog langDialog.XMLFile = "gwtoolkit.xml" langDialog.ShowHmm, shouldn't the "MessageBox" rather be "SelectLanguage"? At least, when I changed it to be, I can get the listbox of available languagesto 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 browsedthe Scripting manual, and found the ClientInformation.UILanguageinstruction. 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, anda 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 interfacelanguage, 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 towhich 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-- Aaron Smith Web Development * App Development * Product Support Specialist GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825 260-489-3671 * gwmicro.com To insure that you receive proper support, please include all past correspondence (where applicable), and any relevant information pertinent to your situation when submitting a problem report to the GW Micro Technical Support Team.-- Aaron Smith Web Development * App Development * Product Support Specialist GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825 260-489-3671 * gwmicro.com To insure that you receive proper support, please include all past correspondence (where applicable), and any relevant information pertinent to your situation when submitting a problem report to the GW Micro Technical Support Team.
