Automatically update SIL after Dictionary Change
Automatically update SIL after Dictionary Change
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.
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
Payroll - HR - T&A
carval.co.uk
Hello,
You can use command-line:
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.
You can use command-line:
Code: Select all
sileditor.exe -a SIL_FILE.SIL DIC_FILE.DIC BASE_LANG_NUM
Best regards,
Igor Siticov.
Igor Siticov.
Thanks Igor,
This would be terrific if it worked. What am I doing wrong?
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.
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
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
Payroll - HR - T&A
carval.co.uk
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.
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.
Igor Siticov.
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:
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
Carval Computing Limited
Payroll - HR - T&A
carval.co.uk
Payroll - HR - T&A
carval.co.uk