Translating DevExpress Components like Grid, Printer...

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Bertopt
Posts: 5
Joined: Thu Sep 01, 2005 7:52 pm

Translating DevExpress Components like Grid, Printer...

Post by Bertopt »

Hi,

I like the TsiLang translations, works really great for my applications.

But I have questions regarding the tranlsations of components like DevExpress for delphi 5... I searched the forum, but didn't got answers to my questions.

1) What's the best way to translate components which have forms and dialogs inside?
So far as I understand it right now, I have to put the siLang component on these forms and translate also const, resources and text constants? So I have to change the original source code?

2) If so, how do I connect the siLang component stored in DevExpress to my application?

Thanks a lot in advance,
ind regars,
Bert
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Actually, almost all (if not all) UI elements strings of DevExpress dialogs are available through resource strings. So you just need to use Resource Strings Wizard to import these strings into TsiLang and TsiLang will handle the rest.
Please let us know if this helps.
Best regards,
Igor Siticov.
Bertopt
Posts: 5
Joined: Thu Sep 01, 2005 7:52 pm

Post by Bertopt »

OK, I see. I played with it.

What's the best way to do that?

Are my steps correct?

1) Start the wizard
2) My base language is German, so using the the wizard to import to languageN2 (=English), while components are in English
3) mark the English Resource ID's
4) finish
5) using the dictionary to autotranslate

questions:
a) Is this correct?

b) What I found is that I have to mark every single Resourcestring, at least I have a couple of hundred's. Is there a way to mark multiple entries at once?

c) I have to do that for every project? Marking all the resources is much work. Is there an easier procedure?

d) In the manual I read that the resource ID's can change with every compilation... Does that mean at the end that there can be a mismatch of ranslation? If yes, how can I avaoid that?

Thanks a lot,
kind regards,
Bert
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Yes, your steps are correct.
Please find below the answers:
a) Yes :)
b) Multi selection is available. Also the popup-menu helps to perform additional actions for selection.
c) It would be easier to create some common datamodule and place there the TsiLang. Import to it the resource strings and later just share this module among other projects. In this case you will be able to perform translations just one time and later just re-use this data-module.
d) No, there won't be any mismatch because for such cases TsiLang uses the per-value translation for resource strings but not per-ID. So it searches by the resource string value not by its ID. This is why it is needed to define ResourceLanguageIndex.
Best regards,
Igor Siticov.
Bertopt
Posts: 5
Joined: Thu Sep 01, 2005 7:52 pm

Post by Bertopt »

Yeap, thx. That helps.

I'm not very familiar with the common datamodule. Do you have a whitepaper for that? How can I link them together in other projects?

Thanks a lot in advance,
Bert
Bertopt
Posts: 5
Joined: Thu Sep 01, 2005 7:52 pm

Post by Bertopt »

So far as I figured out right now:

1) create a datamodule, store it in a common folder for later use also.
2) placing TsiLang inside the datamodule
3) put a TsiLangLinked component on the project form
4) setting the property of siLangLinked1.CommonContainer to DataModule2.siLang1
5) insert the resource strings into the TsiLang datamodule component

for later use in other projects:
6) Add the datamodule 2 to the project
repeat steps 3+4

So far that looks like that this is working.

Some questions:

a) If I switch the language in my mainForm, the datamodule language isn't switched. Something I missed?

b) From my understanding right now I can have only one commoncontainer, so all my global translations resides in one datamodule?

Thanks a lot,
kind regards,
Bert
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

TsiLang on datamodule doesn't switch language because you didn't set its LangDispatcher property to the dispatcher from the project. You can assign this in code:
1. I assume you switch languages by changing ActiveLanguage property of TsiLangDispatcher used in project.
2. In Main form's or the form with TsiLangDispatcher creation event just set DataModule1.siLang1.LangDispatcher := siLangDispatcher1; (where DataModule1 is the name of your common datamodule and siLangDispatcher1 is used in project).

CommonContainer property is used to indicate where are stored "common" translations like Dialogs. For resource strings translations shall be used :!: only one :!: TsiLang per project. But in case you need to share the common dialogs translations between projects as well as resource strings translations it would be smart to have them in same common module.
Please let me know if this helps.

Also, you can download User's Guide from our download page. It contains description for each type of components as well as some useful tips and tricks.
Best regards,
Igor Siticov.
Bertopt
Posts: 5
Joined: Thu Sep 01, 2005 7:52 pm

Post by Bertopt »

Thx.

I think this will be the last question:

On my main form I dropped a siDispatcher component. Setup the languagnames, siLanLinked1.langdispatcher to siLangDispatcher1.

in FormCreate:

procedure TForm1.FormCreate(Sender: TObject);
begin
datamodule2.silang1.langdispatcher:=siLangdispatcher1;
end;

that result in an access violation.

Any ideas?

Thanks a lot,
Bert
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

datamodule2 is created later than Form1. Be sure it has been created before TForm1.FormCreate() called (this means that in your project's source datamodule2 creation line must be listed before the Form1 creation line).
Best regards,
Igor Siticov.
Post Reply