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


Translating Resource Strings


 

Since Version 5.1 TsiLang components allows also to handle resource strings of your project even they are hidden somewhere in a .dcu (.obj) file and you do not have its source. If you desire you application displays language dependent resource strings, first, you should set TsiLang component's property "HandleResourceStrings" to True and ResourceLanguageIndex to value that corresponds to resource language number in TsiLang LangNames property index.

How it works? Every time a resource string is about to be used in application the one of the following functions LoadStr(), FmtLoadStr() or LoadResString() is implicitly called. But if TsiLang property HandleResourceStrings is True any resource string before its loading is replaced by its equivalent corresponding to the active language of the TsiLang. 

Second, you need add resource strings that should be translated to "Strings" list of TsiLang component. The simplest way to do it is to use "Resource Strings Importer" wizard that supplied along with TsiLang Components Suite. This is a standalone application but also can be launched from the TsiLang Expert's menu Tools | Wizards | PE Import

Let's go through the process with "Resource Strings Wizard". Open the wizard:

Resource Strings Wizard - Step 1

On the first step you need to select an executable that store resource strings (if the wizard is launched from TsiLang Expert it is already done), that is your project.

Adjust available options to configure the Wizard's behavior.

Resource Strings Wizard - Step 2

On the second step you should select a unit with a TsiLang component placed where imported strings will be inserted in. After that you can translate those strings by the same way as other hard-coded strings in TsiLang Translation Editor.

Resource Strings Wizard - Step 3

And at last, you select all resource strings that should be handled by a TsiLang component. Most of them are never displayed so we recommend importing only really needed strings. The code of your application does not need any modifications.

Translate resource strings by ID

Version 6.0 of TsiLang Components Suite has introduced the ability to translate resource strings by their identifier not by their value. This is very useful for resource strings that were added to the project resources not from Delphi or C++Builder units but from your own RC or RES files. 

Note: This is not applicable for resource strings created with resourcestring keyword.  

When using resourcestring keyword Delphi's compiler changes resource string identifier every time you re-build your application and usually assigned identifiers are at the highest limit of resource string identifiers (the maximum allowed identifier for resource string is 65535 (0xFFFF or $FFFF in HEX)). But when you explicitly use the RC or RES files in your application the resource identifiers used will be kept permanently.

Unit SiComp has the HighestInternalResourceID global variable that helps you to translate resource strings by their identifier instead of value. Initially its value is set to 0 and this indicates to translate all resource strings (if required) by value. But you can set it to the highest value of your resource string identifier in order to translate your strings by identifier. For example, if your highest identifier is 999 set it to this value and all resource strings with identifier less or equal to 999 will be translated by identifier and others by their values as usually.

This is very useful in cases when you use in your resource strings different translations for the same base phrase. For example, in some cases the same English phrase like File can be translated differently for menu item caption and for document term or other. Using translation by identifier will help you in such cases but translation by value will always return first occurrence of File in translations string.



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