Multiple language files

All announcements, questions and issues related to the TsiLang Components Suite.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Multiple language files

Post by christan »

Hi,

I have just started trying out TsiLang, and I seem to have encountered some difficulties. I have an app written in Delphi, and I have placed a TsiLang and a TsiLangDispatcher in a datamodule. All other forms have a TsiLangLinked.

Now, assume the following scenario:

1) I want to have each language in a separate .SIB file. e.g. English.sib, Chinese.sib, etc.

2) My app should be able to detect all available language files in a specific folder and let user choose which language to use.

How should I go about doing this ? In particular:

1) How do I create all the separate language files ? Is there an export feature of some kind ?

2) How do I remove all the translations that are being compiled into the EXE ? Do I use Tsilang Expert > File > Clear Translations ?

3) What kind of settings would I use for the TsiLangDispatcher ?

4) In the future, when I have some new items to translate, will I have to load all the language files, then export it all again, one by one ?


Also, while trying out TsiLang, I came across a few odd things.

1) In the SIL Editor, how do I delete a particular language ? It appears "Tools > Remove Language" will remove the language in the last column ? Why not allow the user to select which language to remove ?

2) Are there some issues with the SIL editor with regards to deleting languages and saving/opening projects repeatedly ? I was trying to create all the language files and also tried to merge them, and I ended up with several corrupted SIB files.

Thanks in advance for your time and assistance.

Regards,
Chris
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hi,

1. To create SIB file containing only one language you can just delete all other languages from "base" SIB file.
2. Yes to remove translations from TsiLang use Clear Translations.
3. I assume you will need to dinamically point FileName property of TsiLangDispatcher to needed SIB file at the very beginning of application in order to have all forms displayed in needed language.
4. Yes, to update SIB file with newer items you will need first load SIB (better with all languages) to project; call Update Translations and save back to SIB file. This will fill SIB file with newer items, delete obsolete items and keep existing translations.

We're working now under version 6.0 and there will be implemented deleting of any language from SIL Editor.
Actually, I can't imagine what could you do in order to create corrupted SIB file, but, I'm sure, in any case SIL Editor is very easy application and you will be able to process easily with it.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

Hi,

I think you really should consider adding some kind of feature to allow for saving of one or more selected languages to a separate file. The current method of having to delete all unwanted languages one-by-one and save is really troublesome when you have more than a few languages.

About dynamically changing the FileName property of TsiLangDispatcher, what about the other properties like LangNames, ActiveLanguage, etc ? I don't need to use the LoadAllFromFile() ? So do I leave the FileName property blank during compile and just assign the filename during program startup ?

Also, after saving my test project to a .SIB file, I try to open it in SIL Editor and got the following error message:

Unable to open C:\Test\App\Languages.sib!
Error: Error reading sllMain.Language: Language name shall be included in LangNames property!

What's wrong ?
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

Hi,

Just wondering, do you by any chance have a simple demo that shows how to work with multiple language files ? I've been doing some tests but keep getting the following error:

Project Project1.exe raised exception class ELanguageError with message 'Language name shall be included in LangNames property!'.

What exactly does the above mean anyway ?
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

christan wrote: Project Project1.exe raised exception class ELanguageError with message 'Language name shall be included in LangNames property!'.
What exactly does the above mean anyway ?
This means that some TsiLang has its Language property set to value that is not included into LangNames property.

Demo for multiple SIB files will follow in few hours.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

isiticov wrote:
christan wrote: Project Project1.exe raised exception class ELanguageError with message 'Language name shall be included in LangNames property!'.
What exactly does the above mean anyway ?
This means that some TsiLang has its Language property set to value that is not included into LangNames property.
Okay, but the problem is, the same SIB file is also causing this error in the SIL Editor (not only in my test program) as I have mentioned above. I tried again to re-create the SIB file with the problems follows:

Assume there are 3 languages A, B and C, and I want to create a SIB file for language B. I use the SIL Editor to swap language A with language B, then delete language C and A. During this process, I save the SIB file after each operation. Now, the SIB file seems to be working fine. Previously, when I only save the SIB file after finish doing ALL the operations, it resulted in a problematic SIB file.
isiticov wrote: Demo for multiple SIB files will follow in few hours.
Thanks :) ... really appreciate it.

Chris
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

At http://www.sicomponents.com/soft/demos/ ... nguage.zip is available requested demo. Please let me know if this helps.
There is definitely bug in SIL Editor with removing languages. We will fix it. Meantime as workaround could be used to save SIB file after each language removal.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

isiticov wrote:At http://www.sicomponents.com/soft/demos/ ... nguage.zip is available requested demo. Please let me know if this helps.
There is definitely bug in SIL Editor with removing languages. We will fix it. Meantime as workaround could be used to save SIB file after each language removal.
Thanks for the demo, it worked great :) ...

Now, I've got a different yet similar problem, but with a DLL. I would like to also dynamically load language from multiple language files, but when I tried it using TsiLang.LoadAllFromFile(C:\English.sib, True) ... it resulted in some kind of error. Could you also provide a demo on how a DLL can support multiple language files ?

Once I can get this working, I will be registering TsiLang :)
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

For loading from SIB file it must be used LoadAllFromBinaryFile method. Could you please let us know what kind of errors you have with it? And in case there are still any problems with this just let us know the sample "architecture" you would like to see in demo for this. But loading from DLL doesn't differ from loading in EXE except you must care about file paths and so on.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

isiticov wrote:For loading from SIB file it must be used LoadAllFromBinaryFile method. Could you please let us know what kind of errors you have with it? And in case there are still any problems with this just let us know the sample "architecture" you would like to see in demo for this. But loading from DLL doesn't differ from loading in EXE except you must care about file paths and so on.
Hi, thanks for the really quick reply. I changed to LoadAllFromBinaryFile method, but still the same problem.

I wish I can be more specific on the error, but I am localizing a Windows shell extension DLL, so I can only test it by actually using it in Windows Explorer. When I right-click some files, the shell extension adds some additional menu items to the popup menu. In this case here, when I right-click some files, the shell extension loads the language file, then crashes the entire Windows Explorer.

Before I made the change to using separate language files, where translations were stored in the DLL itself, it worked fine. I had no problems switching between two languages.

I localized the DLL by adding a DataModule with a TsiLang component. I then used that to translate all the string in all the unit files belonging to the DLL. I'm not sure if my method is correct or the best way to do it. Also, can I ask where would be the best place to load the language file in the DLL ?

Thanks in advance for your time and assistance.

Regards,
Chris
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

Hi,

Just to let you know that I have managed to get it to work, so there's no need for a demo anymore :D ...

Chris
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Great! Your message arrived while I was typing the answer. Glad to see it works for you.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

isiticov wrote:There is definitely bug in SIL Editor with removing languages. We will fix it. Meantime as workaround could be used to save SIB file after each language removal.
Just wondering when will the fixed SIL editor be released. The reason I am asking is because the work around you mentioned do not work all the time. It works most of the time, but I have also encountered several instances where it did not work, and it's really quite irritating having to start all over again when it doesn't work.
isiticov
Site Admin
Posts: 2385
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

At http://www.sicomponents.com/soft/beta/SILEditor.zip you can try latest beta and let us know if it fixed the problem.
christan
Posts: 10
Joined: Thu May 19, 2005 9:18 am

Post by christan »

isiticov wrote:At http://www.sicomponents.com/soft/beta/SILEditor.zip you can try latest beta and let us know if it fixed the problem.
Thanks, am trying it out. Will let you know if there are any problems.

BTW, the buttons in my message dialogs using MessageDlg() does not seem to get translated. I have made the necessary translations under "Dialog" in the TsiLang component, and the TsiLangLinked component on my form is linked to the TsiLang. Is there something else that I need to do ?
Post Reply