CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


 

Translation of hard-coded strings


 

TsiLang Components Suite allows you not only to translate your control's captions and other string properties, but also hard-coded strings, as well as constants declared under CONST section of a unit (See: Translation of CONST section).

 

TsiLang does this by modifying the source code in a way that the translation for a given string is retrieved automatically at run-time.

 

To translate a unit with a form select File|Source|With Form... (or File|Source|Without Form... for a unit without a form) from the TsiLang Expert main menu. TsiLang will scan the source code of each of selected units and will display the list of all hard-coded strings found.

 

 

The list displays:

a) The String ID. TsiLang generates a String ID for each string found. This ID will be used at run-time to retrieve the translation corresponding to a given string. TsiLang starts generating from IDS_0, but you can change this pressing the Start ID button and entering a new value.

b) The original string.

c) The code line that will replace the corresponding string.

d) The source line that contained the string.

Note: You can modify both a) and c) manually or even delete some of the strings. If you modify the string ID TsiLang will prompt you to replace all references to the old ID with the new one. 

Finally, you have to press the Replace button to let TsiLang  do the necessary changes to your source code.

 

Naturally, when you translate a unit that doesn't have an associated form, there is no TsiLang component that can 'translate' the strings at run-time. Here comes the only difference between translating a unit with or without a form. In the second case, you will have to choose which TsiLang component (or, rather, lying on which form) will do the translation of your strings at run-time.

 

Note: You can select several units from the list and apply this operation all of them simultaneously.

 

Here you can see the way TsiLang deals with hard-coded strings

 

Before

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  Caption := 'MyProgram';

end;

 

After

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  Caption := TsiLang1.GetText('IDS_1' (* 'MyProgram' *) );

end;

 

See also

Checking for bad string IDs



You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web