Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to test for all locales?

Status
Not open for further replies.

Bobby2004

Programmer
Mar 10, 2004
82
IN
I want to test a certain International application for all locales. I have tried checking all the boxes in the Regional Options Language Settings for the System list-box but when I call EnumSystemLocales with LCID_INSTALLED ( and also LCID_supported )the API iterates only once and I get only the US locale. How can I install all the locales on my computer for the purpose.
 
What a lot of people do is get the MSDN subscription with all the international versions of Windows, and then install them inside Virtual PC. So you'll have a ~4gb file that has French Windows, and another ~4gb file that has Turkish Windows, etc.

Virtual PC has an additional advantage - if you're testing your application's installer, and you want to get back to a known state, you tell it not to commit any changes that were made to disk. So the next time you run it, it's fresh again.

You'll need a fast computer and lots of RAM to use it, but it's incredibly productive. I use it to keep all my customer's projects separate from each other.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
What I mean is that I want my application to support multiple language not for it to run in multiple locations
 
And Chip H has given a solution for that.

Using Virtual PC or VMWARE (or slmilar products) is the best way for people to test if their applications will support multiple languages (Input), specially if they are also allowing for multiple DISPLAY languages (e.g. labels and menu text).


As for locales whitin the same PC, you need to install them and when you go to your application you need to change the Keyboard to be the particular country you wish to work with. This will change the type of information that is supplied to your program when you call some API's.


Now if you wish your application to support multiple languages within the same document, the same way word processores do, then that is a different story.


If this is still not satisfactory, then please supply us with more details of WHAT you are trying to accomplish with this exercise, and if at all required/possible with some code snipets that ilustrate your requirements/problems.



Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thanks Frederico ( and sorry for the long gaps - I can't help it for the time being ).

No I don't want to mix multiple languages in the same document as in Word. What I nedd is to switch over to any lnguage entirely as you say in the para before. I want to create a pick-list implemented as an image-combo listing all the locales that Windows supports and when the user picks any one locale the entire app should change over to the selected labguage labels input and all. I am using enum system locales to populate the image-combo but try as I might I the combo-box only lsists US English.

I can't undersrand how chiph's solution meets my requirement.

Any help is appreciated.
 
OK, different problem than what you originally asked. The question should have been "How do I make my application multi-lingual?"

And you do that by storing all the localizable content in a database or XML file that gets read at runtime. So if the user is to be shown the "Account Maintenance" form, you would query the database to retrieve all the strings, icons, graphics, etc. for that form, loop thru all the labels, image controls, etc, and replace the "Account Number" with "Numéro de compte", and so forth.

The database will likely be keyed by:
Locale (en-US)
Form (frmAccountMaintenance)
ControlType (label)
Item (the item)

Alternatively, you can store a key value in the control's Tag property, but that might be a hassle to maintain.

BTW, this is something that .net does very easily, and may be enough of a reason for you to switch.

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
Still cold! I have stored all localized versions of labels ( actually only English to start with ) as a resource and use LoadResString to retreive them. However when when the user picks ( say ) German from the pick-list, I want to be able to change all the labels to German ( I am willing to use LoadResString again for all of them ). I also need my data/time, numeric etc. formats to henceforth be for Germany and for that I suppose I must use GetLocaleInfo but that will work only if the German locale is installed. Right? One question is how to install the Germal locale?

About .Net - can't think of it as I'm too old now to learn 5000 classes and perhaps 5000 quirks. This will be my last project at code level and I hope to write .Net compatible code and leave the upgrade to someone else. My only regret about classical VB is its lack of inheritance and I'm trying to figure out if Implements can be used to construct a derivation based program so the upgrade will be too. Any ideas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top