Empty DialogCaptions when 6.3.1 reads a 6.3.0.2 SIB File
Posted: Fri Jan 16, 2009 6:17 pm
TsiLang Suite v6.3.1.
We found two problems when v6.3.1 reads SIB files that have been created with v6.2.2 then edited with v6.3.0.*
.
1) TranslationEditor problem:
The new TranslationEditor of v6.3.1 adds extra "empty" DialogCaptions when reading those SIB files. If we do any change then save such a SIB file, we sometimes get two groups of extra empty DialogCaptions.
2) Wrong Captions displayed by siDialog:
Button captions are incorrect when the second language is active.
Cancel button, for example, displays "||Abort". Here, "||" stands for the display for two control characters: "#13#10", the delimiter between CaptionDisplay items in the SIB.
Workaround:
Both problems disapear if we export the SIB file as a SIL, then export back that SIL to the original SIB.
By the way, the new SIB is smaller that the original one. Some sections are removed, such as IsInheritedOwner, ActiveLanguage and DoNotTranslate.
Problem of that workaround:
The ExtendedTranslation section is corrupted by this workaround.
The property kind becomes "tkUnknown" instead of "tkInteger"
Origin of the problem:
I dropped an eye into TsiLang sources and seen that the object "FsiCustomLang.DlgsCaptions" contains some extra Strings at the beginning of the list. Those extra strings, not from the SIB, are a Default Set of "DialogCaptions".
When "GetTextFrom" searches in that list to find "Cancel", it finds the first occurence, which is the one in the extra default Set. Then, "GetTextFrom" skips two "#01" to get the translation for the second language. Unfortunately, in the Default Dialog Set, there is only one language. After the second "#01", "GetTextFrom" find the ID of the next caption which is "#13#10Abort" and returns that as the French translation for "Cancel".
Here is the result of DlgsCaptions.Text:
'Warning'#1'Warning'#1#$D#$A
'Error'#1'Error'#1#$D#$A...
'Cancel'#1'Cancel'#1#$D#$A
'Abort'#1'&Abort'#1#$D#$A
'Retry'#1'&Retry'#1#$D#$A...
Then followed by the real DialogCaptions that come from the SIB:
'Warning'#1'Warning'#1'Avertissement'#1'Advertencia'#1#$D#$A
'Error'#1'Error'#1'Erreur'#1'Error'#1#$D#$A'...
'Cancel'#1'Cancel'#1'Annuler'#1'&Cancelar'#1#$D#$A
'Abort'#1'&Abort'#1'&Abandonner'#1'C&ancelar'#1#$D#$A'...
We found two problems when v6.3.1 reads SIB files that have been created with v6.2.2 then edited with v6.3.0.*

1) TranslationEditor problem:
The new TranslationEditor of v6.3.1 adds extra "empty" DialogCaptions when reading those SIB files. If we do any change then save such a SIB file, we sometimes get two groups of extra empty DialogCaptions.
2) Wrong Captions displayed by siDialog:
Button captions are incorrect when the second language is active.
Cancel button, for example, displays "||Abort". Here, "||" stands for the display for two control characters: "#13#10", the delimiter between CaptionDisplay items in the SIB.
Workaround:
Both problems disapear if we export the SIB file as a SIL, then export back that SIL to the original SIB.
By the way, the new SIB is smaller that the original one. Some sections are removed, such as IsInheritedOwner, ActiveLanguage and DoNotTranslate.
Problem of that workaround:
The ExtendedTranslation section is corrupted by this workaround.
The property kind becomes "tkUnknown" instead of "tkInteger"

Origin of the problem:
I dropped an eye into TsiLang sources and seen that the object "FsiCustomLang.DlgsCaptions" contains some extra Strings at the beginning of the list. Those extra strings, not from the SIB, are a Default Set of "DialogCaptions".
When "GetTextFrom" searches in that list to find "Cancel", it finds the first occurence, which is the one in the extra default Set. Then, "GetTextFrom" skips two "#01" to get the translation for the second language. Unfortunately, in the Default Dialog Set, there is only one language. After the second "#01", "GetTextFrom" find the ID of the next caption which is "#13#10Abort" and returns that as the French translation for "Cancel".
Here is the result of DlgsCaptions.Text:
'Warning'#1'Warning'#1#$D#$A
'Error'#1'Error'#1#$D#$A...
'Cancel'#1'Cancel'#1#$D#$A
'Abort'#1'&Abort'#1#$D#$A
'Retry'#1'&Retry'#1#$D#$A...
Then followed by the real DialogCaptions that come from the SIB:
'Warning'#1'Warning'#1'Avertissement'#1'Advertencia'#1#$D#$A
'Error'#1'Error'#1'Erreur'#1'Error'#1#$D#$A'...
'Cancel'#1'Cancel'#1'Annuler'#1'&Cancelar'#1#$D#$A
'Abort'#1'&Abort'#1'&Abandonner'#1'C&ancelar'#1#$D#$A'...