Board index » delphi » Advise please - multi language support

Advise please - multi language support


2003-09-11 08:40:21 AM
delphi102
Can somebody shared about creating multi-language apps?
I am interested to know what strategies to create multi-language apps,
without buying 3rd party solution. The purpose mainly is for fun and
for study, 3rd party solution defeats the purpose. :)
I am interested to know how to do mapping between the string repository
and the components, the best way to store the strings, etc.
I tried to search for multi language at groups.google, and it returns
mainly about multiple language (programming language) in .Net. ^_^
Thanks!
Wien.
 
 

Re:Advise please - multi language support

Erwien Saputra writes:
Quote
Can somebody shared about creating multi-language apps?
There are many fancy solutions. I even wrote a rather complicated
application for doing this, with a Delphi plug-in and all.
But nowadays I use a very simple solution. I just store the strings in
an Excel spreadsheet, each language in each column.
Then I select all rows in each column and save it as a TXT file.
In Delphi applications I load the stringlist at runtime, either form a
disk file, or (what I prefer) from a custom resource embedded in the EXE.
I have a very simple class that does this, and this simple class returns
strings by the index.
I use the same Excel spreadsheet for my .Net and ASP applications too.
In .Net it is as easy as in Delphi, just load the stringlist. In ASP it
is worse, ASP is %&#¤¤% if you would like to know <g>, I still have to
fight with that beast.
When the strings are to be translated, it is convenient to have the rows
with different languages adjacent to each other, most translators know
several languages.
For non-latin alphabets, and non-ascii characters, the picture gets way
more complicated. Frank de Groot is an expert in this field, if he sees
this, maybe he will chime in.
--
Ingvar Nilsen
 

Re:Advise please - multi language support

"Erwien Saputra" <XXXX@XXXXX.COM>writes news:3f5fc45d$XXXX@XXXXX.COM...
Quote
Can somebody shared about creating multi-language apps?
I use Unicode XML files that are loaded, depending on the system locale.
a hybrid approach: I use RTTI to recursively change the font of Win9x controls,
and I use Troy Wolbrink's TNT Unicode controls for Win2000/NT/XP controls.
An example of a file (Chinese):
<?xml version="1.0" encoding="ISO-10646-UCS-2"?>
<!-- open with WORDPAD and use font SIMSUN -->
<!-- save as type UNICODE TEXT DOCUMENT -->
<!-- the comments indicate what the translation means, not what it should mean! -->
<TRANSLATION>
<SECTION NAME="Settings">
<LIGHT>????</LIGHT><!-- stone brightness -->
<SHINE>????</SHINE><!-- stone shininess -->
<THICKNESS>????</THICKNESS><!-- stone thickness -->
<NUMBERS>???</NUMBERS><!-- move number -->
<NO>???</NO><!-- do not display -->
<LAST>?????</LAST><!-- display last move -->
<ALL>????</ALL><!-- display all -->
<CLAMSHELL>???</CLAMSHELL><!-- clamshell intensity -->
<CLAMLINES>????</CLAMLINES><!-- clamshell pattern -->
<SHADOW>???</SHADOW><!-- shadow -->
<BOARD>????</BOARD><!-- goban brightness -->
<SIDES>???</SIDES><!-- index number (sounds strange but used in go software) -->
<SOUND>???</SOUND><!-- sound -->
<RESET>???</RESET><!-- configure again (maybe should become standard RESET in Chinese) -->
</SECTION>
<SECTION NAME="GENERAL">
<OK>??</OK><!-- confirm / accept -->
<CANCEL>??</CANCEL><!-- cancel -->
<GO>??</GO><!-- weichi -->
</SECTION>
</TRANSLATION>
 

Re:Advise please - multi language support

"Erwien Saputra" <XXXX@XXXXX.COM>writes
Quote
Ingvar Nilsen writes:
>There are many fancy solutions. I even wrote a rather complicated
>application for doing this, with a Delphi plug-in and all.
>
>But nowadays I use a very simple solution. I just store the strings in
>an Excel spreadsheet, each language in each column.
>Then I select all rows in each column and save it as a TXT file.

Ingvar,

Thanks for your comment. So you map each line with a component?

I thought of doing so, but I had problem when one of the row was deleted.

I was thinking of something like ID - string pairs, to make the link
stronger, and make it easier to move it to say, database.

I am probing several options for mapping, using component name,
constants, integer, GUID, etc. Using component name was not a good
choice. And I already explained what I thought when using integer.

I also thought of using the tag property, it is nice that the mapping is
in the component itself, I can have generic method that iterates through
the component list, and assign string from stringlist using its index.

But I am not really comfortable of using Tag property.

I am still probing for ideas. Any thought?

Wien.
I don't see anything wrong with using component name. I use it, along with
it's owner, so the key to retrieve the line you need is expressed like
"Form1.Label1". If you also have the default English (or whatever) text
already in the component, then it won't matter so much if a line is missing
in the text file - you just keep the default caption instead of the
translated text.
--Rob McDonell
 

Re:Advise please - multi language support

Quote
Can somebody shared about creating multi-language apps?

I am interested to know what strategies to create multi-language apps,
Have you read the Delphi help on this? That is a useful starting place,
particularly if you don't want to use 3rd party apps.
Lauchlan M
 

Re:Advise please - multi language support

Hello Rob McDonell,
Quote
I don't see anything wrong with using component name. I use it, along with
it's owner, so the key to retrieve the line you need is expressed like
"Form1.Label1".
Here can be a little trouble - you don't need to translate the
components which have assigned TAction, you should translate TAction instead
Quote
If you also have the default English (or whatever) text
already in the component, then it won't matter so much if a line is missing
in the text file - you just keep the default caption instead of the
translated text.
In this case you can additionally write the not translated string to
language file with some mark, f.e #Form1.Label1=File, it will help to
locate and translate such strings.
--
Dzmitry Piatrushenia
ICQ #48665143
 

Re:Advise please - multi language support

On Wed, 10 Sep 2003 17:40:21 -0700, Erwien Saputra
<XXXX@XXXXX.COM>writes:
Quote
Can somebody shared about creating multi-language apps?

I am interested to know what strategies to create multi-language apps,
without buying 3rd party solution. The purpose mainly is for fun and
for study, 3rd party solution defeats the purpose. :)
Check out borland.delphi.public.internationalization, especially
discussions about dxgettext, dybdahl.dk/dxgettext/
Although this is a 3rd party tool, it is an Open Source one, and you can
study it for learning.
--
Anders Isaksson, Sweden
BlockCAD: user.tninet.se/~hbh828t/proglego.htm
Gallery: user.tninet.se/~hbh828t/gallery/index.htm
 

Re:Advise please - multi language support

Great!
THREADS SRL
12 de Octubre 2203
B8003EJQ Bahía Blanca, Bs As
Argentina
Tel/Fax: +54 (291) 488-7451
e-Mail: XXXX@XXXXX.COM
"Anders Isaksson" <XXXX@XXXXX.COM>writes
Quote
On Wed, 10 Sep 2003 17:40:21 -0700, Erwien Saputra
<XXXX@XXXXX.COM>writes:

>Can somebody shared about creating multi-language apps?
>
>I am interested to know what strategies to create multi-language apps,
>without buying 3rd party solution. The purpose mainly is for fun and
>for study, 3rd party solution defeats the purpose. :)

Check out borland.delphi.public.internationalization, especially
discussions about dxgettext, dybdahl.dk/dxgettext/

Although this is a 3rd party tool, it is an Open Source one, and you can
study it for learning.

--
Anders Isaksson, Sweden
BlockCAD: user.tninet.se/~hbh828t/proglego.htm
Gallery: user.tninet.se/~hbh828t/gallery/index.htm
 

Re:Advise please - multi language support

Lauchlan M writes:
Quote

Have you read the Delphi help on this? That is a useful starting place,
particularly if you don't want to use 3rd party apps.

Yes, but so far, I am not satisfied with the way I map the components
and the strings. I am looking for better alternatives.
Wien.
 

Re:Advise please - multi language support

Anders Isaksson writes:
Quote
Although this is a 3rd party tool, it is an Open Source one, and you can
study it for learning.
Great! Thanks.
Wien.