• Advertisement

Archived

This topic is now archived and is closed to further replies.

Multilanguage component recomendations?

This topic is 5988 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! Not strictly gaming related but for my game none the less, Can any one recommend a freeware multilanguage component for use with Delphi5 Professional? I''m not looking for a complete ''no code'' solution but just something a bit easier than having to code one myself from the ground up. Cheers! Chuck

Share this post


Link to post
Share on other sites
Advertisement
Cheers!

I was just wondering if there was a component everyone used when it came to multi-lingural apps, but I guess theres not really one or I just haven''t found it yet

So what I''ll do is play around with a few of the freeware ones and alternative solutions and if I find anything interesting I''ll post it here.


Cheers!

Chuck

Share this post


Link to post
Share on other sites
Writing multilanguage feature

How I did it :

IniFiles,
Fonts,
+ Lots of String varibles (uh ho..)


I made one class contain a whole load of Strings, which would be assigned to buttons captions etc.

Each form had it's own setLanguage procedure, that would manually set each components caption to its String varible counterpart.

I had the String varibles initialised from an IniFile, just in the usual way


This simple setup allows for captions to be changed to those specified by an Inifile (woooooo..!)

This easily allowed for European languages etc but I wanted to support Asian languages too, and heres how!

I found that I could support Asian languages by extending the Ini file to contain Font details, so that the Ini file could choose the font and its size, charset and height of the game application. Once these are correctly setup (Like Font=MS Mincho Charset=128 to show Japanese) the Ini file had to have the value entries for the captions etc set up correctly too.

for example =

[mainform]
title=My Game

in japanese would look something like (in notepad)
[mainform]
title=ƒvƒE


To enter this 'garble' into the text files I found that I had to use Microsoft Word and the Windows IME2000 thingy. The key things to editing a foreign encoding into the INI file is to have word Save and Load the INI file with the correct encoding. For saving its easy because you will find it as an option in the Save Dialog, but for opening, in order to see the Japanese correctly I had to switch on a setting in the General Options tab to have Word always ask for the Encoding of a text file, this was because it just assumed the text file (ini file) was Western encoding each time.

This is just handy to know so you can check and see whether your game is displaying foreign chars or not, even if you don't have a clue what you're writing (like me!).

Make sure your Components are using the ParentFont attribute, as not having this will not see Font changes in a Form reflected in all its components.


Another nice thing to know is that if DelphiX's Surface.Canvas.Font is set up correctly it too will display foreign encoding (yay!) See my screen shot :


[link]http://www.cowzilla.com/sse.gif[/link]

One thing I would look into if I was going to do it again would be using a components[j] loop and GetPropInfo methods to automaticaly detect Caption and Hint property's on components and then to use this to automatically dump/read them to a Ini file. This would save a lot of time....

Hope that serves as a starter to anyone thinking about multilanguage! Theres nothing too difficult and you don't need anything fancy for the scary languages.



Chuck



Edited by - Chikara on December 3, 2001 6:45:41 PM

Share this post


Link to post
Share on other sites

  • Advertisement