siLang load from stream

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Ferenc Nemeth
Posts: 4
Joined: Mon Oct 12, 2015 5:12 pm

siLang load from stream

Post by Ferenc Nemeth »

Hi

i have a simple question. I use TsiLang component. I hava a SIL file for a form. I would like to load this file into a TMemoryStream, and load it into the TsiLang component. How to do it?

My other problem. I have tried to debug the source code. We have the full version. But cannot step into the source code. Creating a very simple project, a form and a siLang on it.

of course the source code path, for example:
"d:\Program Files (x86)\SiComponents\TsiLang\Units" is in the library path.
do you have some idea?

best ragards feri
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Just Use LoadAllFromStream() method of TsiLang component to load data from SIL memory stream.

Add SI_DEBUG compiler conditional define to project options and re-build your project, then you will be able to debug TsiLang units.
Best regards,
Igor Siticov.
Ferenc Nemeth
Posts: 4
Joined: Mon Oct 12, 2015 5:12 pm

Post by Ferenc Nemeth »

hi,
thank you very much for your quick response.

I have tried LoadAllfromStream method of course but after it when I try to set the active language it fails. I see the languages list but nothing in it. After a half day I have found MergeAllFrom,... that loads everything , but when i use GetTextOrDefault it cannot find the translation. I saw the lists of the component for example strings, captions, and everything is all right in it.

So , because this I ask my question. We use
// Version: 7.3
// Release date: 17.09.2014


best regards feri
Ferenc Nemeth
Posts: 4
Joined: Mon Oct 12, 2015 5:12 pm

Post by Ferenc Nemeth »

hi,

now i can debug the LoadAllFrom... i find something

as I see the file starts like this:

'[Language names - for internal use only!]'

because the firs chars this section does not load. As I see the file was saved as UTF8 file and it is the problem. If I save it as ANSI file, there is no problem. We have a lot of languages in the file, and there is Chinese in it.

Language_1=English (US)
Language_2=Hungarian
Language_3=Espanol
Language_4=Svenska
Language_5=Greek
Language_6=Russian
Language_7=Bulgarian
Language_8=German
Language_9=French
Language_10=Romanian
Language_11=Chinese
Language_12=English (EUR)
Language_13=English (UK)
Language_14=Slovak
Language_15=Dansk
Language_16=Turkish
Language_17=Polish
Language_18=Dutch
Language_19=Czech
Language_20=Portuguese
Language_21=Georgian
Ferenc Nemeth
Posts: 4
Joined: Mon Oct 12, 2015 5:12 pm

Post by Ferenc Nemeth »

hi again :-)

sorry , of course there is no problem in your code :-)

so we save the sil file in utf-8 style but the option in the sil file was not set.
IsUTF8File=1

after set it to true, everything is ok, so thank you very much for your help!

best regards from HUNGARY!
Post Reply