Page 1 of 1

Empty DialogCaptions when 6.3.1 reads a 6.3.0.2 SIB File

Posted: Fri Jan 16, 2009 6:17 pm
by Jean-Paul Brassard
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.* :cry: .

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'
...

Posted: Sat Jan 17, 2009 6:57 am
by isiticov
Could you please send us a SIB file that causes such problem to test? I mean a SIB file before your workaround and we will try to repeat all your mentioned steps.

Modification to SIB file format?

Posted: Mon Jan 19, 2009 10:33 pm
by Jean-Paul Brassard
In my message, I observed that the new SIB (after the workaround) is smaller that the original one. Some sections are removed, such as
- IsInheritedOwner,
- ActiveLanguage and
- DoNotTranslate.

The last item, the list of excluded component, is seems the most important one.

Is this an optimisation to reduce file size in TsiLang Suite 6.3.1?

Or is this a bug that can cause us some promblems later on???

Moreover, what should we do with the corrupted property kind?
They become "tkUnknown" instead of "tkInteger".

The Workaround is only a temporary solution

Posted: Wed Jan 21, 2009 1:20 am
by Jean-Paul Brassard
Unfortunately, the workaround posted in the first message of this subject is only a temporary solution :( .

The problem comes back as soon we do a "SaveSelectedForm" command (option "Save/LoadTranslation" of the "File" menu) in TsiLangExpert.

Then we now need a fix very quickly (a line number to change is OK).

Thanks

Cause of the Double Captions and False Translations(?)

Posted: Wed Jan 21, 2009 4:51 am
by Jean-Paul Brassard
I think I put the finger on the bug.

The problem seems to be related with the value of "FSIBLoading" set by the method LoadAllFromFile.

The line 10215 tests FSIBLoading and that prevents the merge between default values and the dialog caption read from the SIB file.

N.B. I sent an email with more details.

Posted: Wed Jan 21, 2009 9:42 am
by isiticov
Please check my reply by email.