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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the languages in your program.

Status
Not open for further replies.

esmet

Programmer
Jul 25, 2011
16
Hi,I have two questions: Does anybody know how to make sth like changing the language of your program for example from english to spanish or backwords(you get the idea)? The biggest problem for me now is how to capture string from the messagebox and translate it.
Are there some helpful components for that problem or solutions?The project is really huge and making many changes in all of the files
would be a problem.

Can anybody help me with solving this?
 
Which version are you using? It's much easier to do with the newer versions (10 and up) than with some of the older version,, e.g., BCB 6. The newer version allow unicode strings while the older versions do not. It can be done in the older version but it is not as easy.



James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
I use embarcadero 2010.
 
Could you tell me how to do it?
 
I'm not familiar with Embarcadero 2010, and (as I'm now retired) it's some years since I used BCB6.

So I can't provide any specific advice, but one method (which DOES, however, involve some changes to your existing code) would be to use a 'message numbering' system, the principles of which are:

(a) Each message has an associated 'message number' (think in terms of 'enumerations').

(b) Within each standard code module, messages are referred to only by their message number.

(c) Special 'message handling' modules are written (one per target language), which contain functions to translate 'message numbers' to 'language-specific' text for each expected message.

(d) The application would require a configuration mechanism to select the required language-specific message handling module for the current user (or session).

(e) Additional languages could then be catered for by adding new 'message-handling' modules.

(f) Some messages could provide optional details via parameters - again, uses enumerated values (rather than plain text) for the parameters (unless the parameters ARE intended to be just numeric values), and then let the message-handing module handle the translation from enumerated parameter value to language-specific text.

... and as James Cottingham has pointed out, use Unicode strings (rather than ANSI strings) to avoid character set translation issues.
 
I'm using Unicode strings, and i've had that kind of idea, but i'm looking for sth else, that i could use. The bes way would be(in my opinion) if there where some kind of component that could catch messagebox message when it's beeing threw on the screen, and then to look, for the translation,depending on the lang., but i think i'll go with your idea.

Thanks for the advice.

P.S. If anyone will have some other suggestions i'll appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top