I need to localize my application and I am experimenting with TsiLang. I use resource string quite often in my units and I notice that TsiLang only converts the first resourcestring occurrence. So for example with the following two procedures only the first string will be handled by TsLang automatically (using TsiLang expert const section):
procedure TIzemailMainFrm.UpdateStrings;
begin
XXX := siLang1.GetTextOrDefault('strXXX');
end;
I can convert all resourcestrings to constants. But, I then need to use the {$J+} complier switch otherwise the const can not be set. Am I doing something wrong?
Const section translation is designed to translate the strings declared at the "top of the unit" (before the first begin occurence, this is why it found only first string in your case). After performing this you can just change Const to VAR or use {J+} directive.
The strings like in your project will need either code modification to move them from local procedures to the "top of the unit" or you can use Resource Strings Wizard and import them to TsiLang from compiled application. In such case no code modofication required and TsiLang will automatically handle resource strings during run-time.