Automatically update SIL after Dictionary Change

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
jsweby
Posts: 32
Joined: Wed May 21, 2008 3:07 pm

Automatically update SIL after Dictionary Change

Post by jsweby »

Hello,

We have a scenario similar to the one posted a couple of years ago here. That is, there is an "equivalences" table which we could let the user edit, that is fed through to the TsiLang components.

Our goal is not to provide multi-language capability in our software, but to allow the user to change key terms in it. For example, what we might have hard-coded on a label as "Department:" might be changed by a customer to "Division:".

We would be looking at allowing about 10 key terms to be altered by the user, and these currently appear on almost 80 forms in our software, currently hard-coded in the TLabel.Caption property.

The solution to the linked post above kind of works and I have tried it to some effect. (That is, to add a procedure that goes through each element in the siLangLinked.Captions property and use ReplaceStringValue to replace "Department" with "Division".) However, to have to add code to every form so that the TsiCustomLang descendant correctly uses the user-defined replacement text seems to undo the benefit of having the translation components in the first place.

Instead of have the user open the SIL Editor for each form and change "Department" to "Division", I'd like them to just be able to open the Dictionary Manager and change it once in there. Once that is done, I'd like to update the SIL file so that any references to "Department" now read "Division". Then no code needs to be added to the software as the SIL file will be correct when the program is run.

The original poster asked if an SIB file could be changed, which I appreciate is much harder as it is a binary file. But that was 2 years ago - is any of what I'm asking now possible, with an SIL or SIB file?

Thanks,
Jason.
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

You can use command-line:

Code: Select all

sileditor.exe -a SIL_FILE.SIL DIC_FILE.DIC BASE_LANG_NUM
this will auto-translate SIL file (SIL_FILE.SIL ) using Dictionary file (DIC_FILE.DIC) and BASE_LANG_NUM- number of the base language in SIL file.
Best regards,
Igor Siticov.
jsweby
Posts: 32
Joined: Wed May 21, 2008 3:07 pm

Post by jsweby »

Thanks Igor,

This would be terrific if it worked. What am I doing wrong?

Code: Select all

"C:\Program Files\Borland\Delphi6\Source\Third-party\TsiLang\SIL Editor\sileditor.exe" -a C:\Temp\siLangTest\silangtest.sil C:\Temp\siLangTest\testdic.dic 1
SILEditor.exe is v4.1.0.1. When I run the above command, the SILEditor flashes up and goes away again, but no files are updated. I tried putting the SILEditor in the same directory as the SIL and DIC files but this made no difference.
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Please try to enclose file names parameters in ""(quotes).
Best regards,
Igor Siticov.
jsweby
Posts: 32
Joined: Wed May 21, 2008 3:07 pm

Post by jsweby »

Yes I already tried that before I posted, made no difference.
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Will investigate the case and reply to you later.
Best regards,
Igor Siticov.
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

We've re-tested this case once again and it looks like it works just fine (for SIL files!).
Best regards,
Igor Siticov.
jsweby
Posts: 32
Joined: Wed May 21, 2008 3:07 pm

Post by jsweby »

I will send you my files via email then and see if there is a problem with my files rather than the translator. Thanks.
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Thank you for the files. Indeed the problem was on SIL Editor's side. The bug is reproducable when your try to auto-translate with DIC file which has base language not included into DIC defined by default (Dictionary Manager -> Options -> Default DIC). We will fix this in next update meantime you can use as workaround either:
1. Define the DIC you use for batch auto-translate as default in Dictionary Manager.
2. Or just add the language with same name as base language you will use for auto-translation to default DIC (it even could be empty with no translations in DIC defined at all).

Please let me know if this helps.
Best regards,
Igor Siticov.
jsweby
Posts: 32
Joined: Wed May 21, 2008 3:07 pm

Post by jsweby »

Yes that has made a difference. The SIL file is now updated. However, it has not actually performed any translation.

If I use the Auto-Translate feature of the SIL Files Editor, I get the options:
  • Case sensitive search
    Skip & when searching
    Overwrite existing items
Is there any way these can be set from the command line as I would like to remove the case sensitive search, and allow overwrite existing items.
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Currently it uses the following settings:

Overwrite existing items = ON
Case sensitive = ON
Skip & = ON

Unfortunately there is no way now to change it. We will try to add additional switches in next version.
Best regards,
Igor Siticov.
jsweby
Posts: 32
Joined: Wed May 21, 2008 3:07 pm

Post by jsweby »

It is working well now, thank you for your time.
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
Post Reply