SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

siLang load from stream

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Ferenc Nemeth



Joined: 12 Oct 2015
Posts: 4

PostPosted: Tue Oct 13, 2015 12:32 pm    Post subject: siLang load from stream Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Wed Oct 14, 2015 4:01 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Ferenc Nemeth



Joined: 12 Oct 2015
Posts: 4

PostPosted: Wed Oct 14, 2015 6:41 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Ferenc Nemeth



Joined: 12 Oct 2015
Posts: 4

PostPosted: Wed Oct 14, 2015 6:59 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Ferenc Nemeth



Joined: 12 Oct 2015
Posts: 4

PostPosted: Wed Oct 14, 2015 7:26 am    Post subject: Reply with quote

hi again Smile

sorry , of course there is no problem in your code Smile

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group