Beginner questions

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Ioan
Posts: 22
Joined: Tue Mar 14, 2006 8:32 pm
Location: Canada
Contact:

Beginner questions

Post by Ioan »

I'm a new user of siComponents package and I have some "basic" questions:
I need to translate from English to French a pretty big Delphi 7 application: 116 forms and 11 code units.
I started by running the wizard which puts a siLangLinked on each form and a siLang and siLangDispatcher on the main form (it's an MDI app).
Then, I set the Languages in dispatcher and I set the CommonContainer to all siLangLinked comps. A couple of small fixes and a small function to switch the languages on-the-fly.
Next, for each form a created a SIL file for the translator, excluding some components and properties and I removed the unnecessary strings from the strings list retrieved from source with form.

Question1:
For all the forms everything looks fine, but I got some trouble with the non-form units. I selected the main unit's siLang component and I prepared the strings list. But when I check the Bad string IDs for this form, I get for all the strings coming from the non-form unit the error: "Not used in source of current module". Is this OK to continue?

Question2:
While my translator will finish his work, I'm still working, changing the project (adding, changing, removing strings), so at one moment I will have to re-search for strings in units. I will get again the entire list of strings I deleted for translation (SQL strings created at run-time, etc) which are a lot. What is the right way to do this? I could take care so every time when I add a string to code it directly in the siLang way (siLang1.GetTextOrDefault('IDS_nn')), but I don't know how to get this ID into the translation list.

More general: what is the right way to "refresh" the SIL file after changes in the code? With a big project like that this is a big issue.

Thanks for all clarification,

Ioan
Ioan
Posts: 22
Joined: Tue Mar 14, 2006 8:32 pm
Location: Canada
Contact:

Post by Ioan »

OK, for the second question I think I found a partial answer:
If I use the siLang1.GetTextOrDefault('IDS_nn')) call for a new string I can go in Translation Editor - strings and add the new ID and string. Same for any change.

Is this the correct way?

Thanks,

Ioan
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Re: Beginner questions

Post by isiticov »

Ioan wrote:I'm a new user of siComponents package

Welcome! :)
and I have some "basic" questions:
I started by running the wizard which puts a siLangLinked on each form and a siLang and siLangDispatcher on the main form (it's an MDI app).
Then, I set the Languages in dispatcher and I set the CommonContainer to all siLangLinked comps.
Actually, the wizard must already make this for you, didn't it?
Next, for each form a created a SIL file for the translator, excluding some components and properties and I removed the unnecessary strings from the strings list retrieved from source with form.
1. I would recommend to use SIB file instead of SIL. It is much faster and stable. Since SIL file is just a modification of INI format.
2. Also you can use one(same) file for all you forms- so you will have just one SIL/SIB file for your application. This is much easier to maintain and deploy. Each TsiLang will load only information for form where it is placed.

Question1:
For all the forms everything looks fine, but I got some trouble with the non-form units. I selected the main unit's siLang component and I prepared the strings list. But when I check the Bad string IDs for this form, I get for all the strings coming from the non-form unit the error: "Not used in source of current module". Is this OK to continue?
Yes, this is OK, actually this is just a warning that states that these strings are not used in the form's unit, but as you noted they are used from another unit. It is quite hard to find all that references. :)
Question2:
While my translator will finish his work, I'm still working, changing the project (adding, changing, removing strings), so at one moment I will have to re-search for strings in units. I will get again the entire list of strings I deleted for translation (SQL strings created at run-time, etc) which are a lot. What is the right way to do this? I could take care so every time when I add a string to code it directly in the siLang way (siLang1.GetTextOrDefault('IDS_nn')), but I don't know how to get this ID into the translation list.
Actually, all strings once added to TsiLang and replaced by GetTextOrDefault() won't be listed again (except for the strings in CONST section).
Also you can use IGNORE tags (http://www.tsilang.com/delphiglobalizat ... faq.html#6) to skip some source lines and they won't be displayed any more. Additionally you can use expert's Options dialog to configure exclude settings.
Then running source scanning will let you to automatically find and add new strings. More at all, expert will analyze new strings and re-use existing strings in case you've added some strings that are already in translations.
More general: what is the right way to "refresh" the SIL file after changes in the code? With a big project like that this is a big issue.
If translations in DFM already contain all information from SIL/SIB file but just new original entries added then you can just save all again into SIL/SIB file and this will create updated version.
In case you need "smarter" way you can use the following:
1. Create new SIL/SIB file from updated project
2. Open it in SIL Editor
3. Use menu File->Merge to merge translations from older SIL/SIB file. The Merge Wizard will allow you to import translations smartly defining which languages to import and other things. (This is very useful wizard!)

Please let me know if this helps.
Best regards,
Igor Siticov.
Ioan
Posts: 22
Joined: Tue Mar 14, 2006 8:32 pm
Location: Canada
Contact:

Post by Ioan »

Thank you for the quick reply.
Actually, the wizard must already make this for you, didn't it?
Yes, it did.
1. I would recommend to use SIB file instead of SIL. It is much faster and stable. Since SIL file is just a modification of INI format.
I will create SIB files in the future. Now the files are already in work.
2. Also you can use one(same) file for all you forms- so you will have just one SIL/SIB file for your application. This is much easier to maintain and deploy. Each TsiLang will load only information for form where it is placed.
It was easier for me until I learn how to work properly. And it was less "depressing" for my translator to handle smaller files than a huge one :)
We don't need to deploy it, because we don't need an user-end translation, just in-house. And in the future will see what is the best.

The problem putting the the strings from non-form units in a common form is that the IDS numbers are dificult to follow, they are not sequential (after cleaning up the unnecessary entries). I hopped to have somehow to know the unit they are coming from.
Actually, all strings once added to TsiLang and replaced by GetTextOrDefault() won't be listed again (except for the strings in CONST section).
Yes, the one Excluded are gone, but the strings I only Delete are coming back so I have to Delete them each time. Anyway, I'll have to prepare a little bit my code because it wasn't ready for this.
Also you can use IGNORE tags (http://www.tsilang.com/delphiglobalizat ... faq.html#6) to skip some source lines and they won't be displayed any more.
This is very useful, I will use it a lot!
Additionally you can use expert's Options dialog to configure exclude settings.
I did use it, it's good, but not enough for a code that is not prepared for this.

I will try the Merge wizard soon, after the first step of translation will be done. I'll let you know.

Thanks again.
Ioan
Post Reply