 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Randall Parker Guest
|
Posted: Wed Jan 14, 2004 6:18 pm Post subject: How to do internationalization in BCB? |
|
|
BCB doesn't appear to have any obvious I18N support. Am I wrong to think that?
In BCB there are all the caption properties where one can, in the designer, set the
text to show in them. If one wants to support the same app in different human
languages then what are the techniques for doing so?
It would be nice if right there in the designer one could assign text to the caption
per language. Have some sort of drop-down list of the format:
LANGUAGE message user sees
Another option would be some separate tool that would analyse your project and
provide you with a list of controls that have Caption properties that are filled in
and show what the values are. Then in other columns in this tool type in text for
other target languages. Then somehow use that result to generate different files (dfm
files? perhaps .dfm.somelanguage) to build in different ways.
Also, can VCL support Unicode as a code page?
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Jan 14, 2004 6:46 pm Post subject: Re: How to do internationalization in BCB? |
|
|
"Randall Parker" <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
message news:400587e9$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Also, can VCL support Unicode as a code page?
|
The majority of the VCL is based on AnsiString, not WideString, and thus
cannot work with or display any foreign Unicode-based languages. Any
Unicode string that is passed to AnsiString is automatically converted to
ANSI/MBCS, which is not the same thing. You would have to use third-party
WideString-aware components for that instead.
Gambit
|
|
| Back to top |
|
 |
David Bridges Guest
|
Posted: Wed Jan 14, 2004 6:48 pm Post subject: Re: How to do internationalization in BCB? |
|
|
I did something simlar to this (for creating Spanish language versions of my
forms) by creating an XML file for each form that lists the names all of the
controls on the form along with their Spanish (or French, or whatever)
captions. At runtime, the program reads this file and changes the captions
on all the controls on the form. Most forms in my application use this
feature. I also built a GUI "maintainer" than can attach to a form and allow
editing of the values - but that's a seperate, independent piece.
Hope that helps
David Bridges
"Randall Parker" <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
message news:400587e9$1 (AT) newsgroups (DOT) borland.com...
| Quote: | BCB doesn't appear to have any obvious I18N support. Am I wrong to think
that?
In BCB there are all the caption properties where one can, in the
designer, set the
text to show in them. If one wants to support the same app in different
human
languages then what are the techniques for doing so?
It would be nice if right there in the designer one could assign text to
the caption
per language. Have some sort of drop-down list of the format:
LANGUAGE message user sees
Another option would be some separate tool that would analyse your project
and
provide you with a list of controls that have Caption properties that are
filled in
and show what the values are. Then in other columns in this tool type in
text for
other target languages. Then somehow use that result to generate different
files (dfm
files? perhaps .dfm.somelanguage) to build in different ways.
Also, can VCL support Unicode as a code page?
|
|
|
| Back to top |
|
 |
Dennis Jones Guest
|
Posted: Wed Jan 14, 2004 7:42 pm Post subject: Re: How to do internationalization in BCB? |
|
|
"Randall Parker" <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
message news:400587e9$1 (AT) newsgroups (DOT) borland.com...
| Quote: | BCB doesn't appear to have any obvious I18N support. Am I wrong to think
that?
In BCB there are all the caption properties where one can, in the
designer, set the
text to show in them. If one wants to support the same app in different
human
languages then what are the techniques for doing so?
It would be nice if right there in the designer one could assign text to
the caption
per language. Have some sort of drop-down list of the format:
LANGUAGE message user sees
Another option would be some separate tool that would analyse your project
and
provide you with a list of controls that have Caption properties that are
filled in
and show what the values are. Then in other columns in this tool type in
text for
other target languages. Then somehow use that result to generate different
files (dfm
files? perhaps .dfm.somelanguage) to build in different ways.
|
I do something along those lines:
I have a separate directory for each language of a project. In each
language directory is a project to generate a resource-only package, and all
of the DFM's and RC's that make up the main project. I have a program that
analyzes the resource-only project files and generates a text file
containing all of the strings used by the various DFM's and RC's in the
projects -- one text file for each language.
The language text files (and an English equivelent) are sent to a translator
along with a separate tool that the translator uses to edit the text. The
tool displays the English text and the translated text (which is initially
English too) and lets the translator enter the alternate language's text.
When the translator is done translating, he sends the translated language
text file back to me.
When I get the translated text file, I merge it back into the DFM's and RC's
for that language (using the same tool that extracted the text initially),
and then compile the resource-only project(s).
The main application does the work of loading the appropriate per-language
resource-only package at run-time, depending on the language selected by the
user of the application, and can be changed by the user at run-time
(assuming he can read and understand that language!!).
There is still some manual work involved, primarily because it requires an
entire separate set of DFM's and RC's for each language, which must be
created ahead of time, along with the resource-only project. Part of that
process involves adjusting the CharSet property for text-based components
appropriately for the target language. Another problem with this method is
that if the text doesn't fit on the form after translation, it must be
size-adjusted to fit. Also, the text extraction/merge tool I use is pretty
lame (it was written by someone else), and I haven't had the time to fix it.
If I had my druthers (and I don't in this case-- the client doesn't want to
pay for the effort to create a better solution), I'd redesign the forms so
they could handle any language text without needing to be resized (the
client doesn't want to do this because they say some languages would require
the forms to be huge (like German or Dutch), and they don't want other users
(English) to have huge forms when it isn't necesasry -- oh well). Then I'd
create the per-language DFM's, RC's, and resource-only project files
automatically at build-time, automatically adjust the Charset of the
text-based components as necessary, and merge the per-language text just
before compiling. With this scheme, I would never have to create
resource-only projects ahead of time, nor would I have to create copies of
the DFM's and RC's manually, and everything would happen automatically at
build-time. The only manual processes would be extracting the translatable
text and the translation.
That was a long-winded way of saying there are many different solutions. It
all depends on how you want to do it. This is just how I do it today.
- Dennis
|
|
| Back to top |
|
 |
Michael Brazee Guest
|
Posted: Wed Jan 14, 2004 8:15 pm Post subject: Re: How to do internationalization in BCB? |
|
|
Randall,
I have used both with success.
1) free - http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls.htm
Controls are derived from VCL controls with AnsiString replaced by
WideString. Unicode works only on WinNT based OSes, not Win/9X.
2) not free - Eldos controls -
http://www.ceberus.com/lmd/products/lmdelpack/
"Randall Parker" <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
message news:400587e9$1 (AT) newsgroups (DOT) borland.com...
| Quote: | BCB doesn't appear to have any obvious I18N support. Am I wrong to think
that?
In BCB there are all the caption properties where one can, in the
designer, set the
text to show in them. If one wants to support the same app in different
human
languages then what are the techniques for doing so?
It would be nice if right there in the designer one could assign text to
the caption
per language. Have some sort of drop-down list of the format:
LANGUAGE message user sees
Another option would be some separate tool that would analyse your project
and
provide you with a list of controls that have Caption properties that are
filled in
and show what the values are. Then in other columns in this tool type in
text for
other target languages. Then somehow use that result to generate different
files (dfm
files? perhaps .dfm.somelanguage) to build in different ways.
Also, can VCL support Unicode as a code page?
|
|
|
| Back to top |
|
 |
Simon Macneall Guest
|
Posted: Wed Jan 14, 2004 10:47 pm Post subject: Re: How to do internationalization in BCB? |
|
|
Randall Parker <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
news:400587e9$1 (AT) newsgroups (DOT) borland.com:
| Quote: |
Another option would be some separate tool that would analyse your
project and provide you with a list of controls that have Caption
properties that are filled in and show what the values are. Then in
other columns in this tool type in text for other target languages.
Then somehow use that result to generate different files (dfm files?
perhaps .dfm.somelanguage) to build in different ways.
|
We have just started down this road, and have decided on GNU gettext for
Delphi (<http://dybdahl.dk/dxgettext/>). It works find in BCB and does
exactly what you are looking for with a minimum of fuss.
Simon
|
|
| Back to top |
|
 |
Simon Macneall Guest
|
Posted: Wed Jan 14, 2004 11:30 pm Post subject: Re: How to do internationalization in BCB? |
|
|
OBones <obones_fff_ (AT) meloo_fdf_ (DOT) com> wrote in
news:4005de0c (AT) newsgroups (DOT) borland.com:
| Quote: | I'm using the exact same one and it is a real pleasure to use it,
nothing complicated at all.
|
We were a bit worried about have a borland only solution (we have projects
in BCB and VC) but managed to get the base GNU gettext working the same in
VC with a minimum of fuss.
Simon
|
|
| Back to top |
|
 |
Ken de Camargo Jr. Guest
|
Posted: Wed Jan 14, 2004 11:40 pm Post subject: Re: How to do internationalization in BCB? |
|
|
Simon Macneall wrote:
| Quote: | Randall Parker <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
news:400587e9$1 (AT) newsgroups (DOT) borland.com:
Another option would be some separate tool that would analyse your
project and provide you with a list of controls that have Caption
properties that are filled in and show what the values are. Then in
other columns in this tool type in text for other target languages.
Then somehow use that result to generate different files (dfm files?
perhaps .dfm.somelanguage) to build in different ways.
We have just started down this road, and have decided on GNU gettext
for Delphi (<http://dybdahl.dk/dxgettext/>). It works find in BCB and
does exactly what you are looking for with a minimum of fuss.
|
I've made an utility that reads all dfms in a BCB project, creates
resource files and adds code to load the resource strings. It's called
"Hello, world" (OK, I wasn't particularly inspired then) and is freely
available from my page (see url below).
--
Ken
http://planeta.terra.com.br/educacao/kencamargo/
|
|
| Back to top |
|
 |
Simon Macneall Guest
|
Posted: Thu Jan 15, 2004 12:05 am Post subject: Re: How to do internationalization in BCB? |
|
|
OBones <obones_fff_ (AT) meloo_fdf_ (DOT) com> wrote in
news:4005e6b8 (AT) newsgroups (DOT) borland.com:
| Quote: |
We did that too, except that we extended it to automatically translate
an MFC application. That's a bit of a pain, and doesn't really allow
changing language at runtime, but it does work.
|
Most of our VC stuff is dlls with little or no UI, so we shouldn't have to
go to that extent (touch wood).
|
|
| Back to top |
|
 |
OBones Guest
|
Posted: Thu Jan 15, 2004 12:25 am Post subject: Re: How to do internationalization in BCB? |
|
|
Simon Macneall wrote:
| Quote: |
We have just started down this road, and have decided on GNU gettext for
Delphi (<http://dybdahl.dk/dxgettext/>). It works find in BCB and does
exactly what you are looking for with a minimum of fuss.
I'm using the exact same one and it is a real pleasure to use it, |
nothing complicated at all.
|
|
| Back to top |
|
 |
OBones Guest
|
Posted: Thu Jan 15, 2004 1:02 am Post subject: Re: How to do internationalization in BCB? |
|
|
Simon Macneall wrote:
| Quote: |
We were a bit worried about have a borland only solution (we have projects
in BCB and VC) but managed to get the base GNU gettext working the same in
VC with a minimum of fuss.
|
We did that too, except that we extended it to automatically translate
an MFC application. That's a bit of a pain, and doesn't really allow
changing language at runtime, but it does work.
|
|
| Back to top |
|
 |
Brent Guest
|
Posted: Thu Jan 15, 2004 2:10 am Post subject: Re: How to do internationalization in BCB? |
|
|
I read a chapter in BCB Developer's Guide 5 about this very topic. It
provided excellent ideas.
regards,
Brent
"Randall Parker" <STOPtechiepundit (AT) EVILfuturePOXpunditSPAM (DOT) com> wrote in
message news:400587e9$1 (AT) newsgroups (DOT) borland.com...
| Quote: | BCB doesn't appear to have any obvious I18N support. Am I wrong to think
that?
In BCB there are all the caption properties where one can, in the
designer, set the
text to show in them. If one wants to support the same app in different
human
languages then what are the techniques for doing so?
It would be nice if right there in the designer one could assign text to
the caption
per language. Have some sort of drop-down list of the format:
LANGUAGE message user sees
Another option would be some separate tool that would analyse your project
and
provide you with a list of controls that have Caption properties that are
filled in
and show what the values are. Then in other columns in this tool type in
text for
other target languages. Then somehow use that result to generate different
files (dfm
files? perhaps .dfm.somelanguage) to build in different ways.
Also, can VCL support Unicode as a code page?
|
|
|
| Back to top |
|
 |
Pete Fraser Guest
|
Posted: Thu Jan 15, 2004 9:42 am Post subject: Re: How to do internationalization in BCB? |
|
|
| Quote: | We have just started down this road, and have decided on GNU gettext for
Delphi (<http://dybdahl.dk/dxgettext/>). It works find in BCB and does
exactly what you are looking for with a minimum of fuss.
|
This is an excellent free product. You add a single pascal file to your
project and add a single call to each form to translate it at run time. Then
you use the windows context menu to extract all strings to a .po file which
you can edit and translate using the poedit application. Users can thus
translate their own strings.
The only thing you have to do in code is replace all occurrences of "a
string" with _("a string") so that the string extraction application works.
Its very simple once you start using it.
--
HTH Pete
=================================
GenHelp: The Component Authors help writer
Web: www.frasersoft.net/genhelp
=================================
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|