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 

.sil file problem

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



Joined: 17 Aug 2004
Posts: 11

PostPosted: Wed Oct 13, 2004 6:04 am    Post subject: .sil file problem Reply with quote

Hi all,

I have a strange problem with translating using .sil file. On my designer computer everything works fine but when I install the application on other computer function "GetTextOrDefault" do not extract strings. I am receiving empty string.

All other strings (like captions on the forms) are OK and translated.

In the application I am using LandDispatcher, one LangRT and everywhere else LangLinked components.

All my applications are build with runtime packages and together with my application I am distributing TsiLang_D7 package.

What could be wrong? Again on my computer all is OK. Application is runing proparlly so I think all packages are delivered, but....??

Thanks
Kristijan Deberni
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Wed Oct 13, 2004 8:49 am    Post subject: Reply with quote

1. TsiLangRT is necessary only! if you need run-time editing of translations by your end-user.
2. Make sure that path to SIL file used is either FULL or correctly detected.

P.S. TsiLang_D7 package is not needed since it is only design-time package.
Back to top
View user's profile Send private message
kdeberni



Joined: 17 Aug 2004
Posts: 11

PostPosted: Wed Oct 13, 2004 12:17 pm    Post subject: Reply with quote

The sil file is detected properlly as far as all captions on forms are translated and if I remove sil file nothing is translated. But in both cases function "GetTextOrDefault" is not extracting string returning empty like it does not exists at all but it is in file.

Any other idea?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Oct 14, 2004 6:06 am    Post subject: Reply with quote

Please try to verify SIL file using some text editor or SIL Editor that it has valid format.
Back to top
View user's profile Send private message
kdeberni



Joined: 17 Aug 2004
Posts: 11

PostPosted: Thu Oct 14, 2004 7:05 am    Post subject: Reply with quote

Can you please take a llok at my code:

function TdmLanguage.TranslateStr(Str: string): string;
var
s: string;
begin
s := siLangRT.GetTextOrDefault(Str);
if s = '' then begin
if siLangRT.AddString(Str, [Str]) then
siLangRT.SaveStringsToFile(siLangRT.LangDispatcher.FileName, STRING_DELIM);
s := Str;
end;
Result := s;
end;

I am using this function for translating some "dinamically" changing strings. As you can see if the string is not found in the file it will be saved and latter somebody can just translate it.

For tests I have done a new file only with couple strings in [Strings] section. On the begining my file have a look like this:

[Language names - for internal use only!]
Language_1=English
Language_2=Polski
Language_3=Deutsch

[OPTIONS]
DELIMITER=~!@#$

[Strings]
TdmLanguage.&Asset=&Asset~!@#$Środki trwałe~!@#$Inventar~!@#$
TdmLanguage.&Companies=&Companies~!@#$Firmę~!@#$Firmen~!@#$
TdmLanguage.&Configuration=&Configuration~!@#$Konfiguracja~!@#$Konfiguration~!@#$
TdmLanguage.&Help=&Help~!@#$&Pomoc~!@#$&Hilfe~!@#$
TdmLanguage.&Machine base=&Machine base~!@#$Baza sprzętowa~!@#$Grundmaschine~!@#$
TdmLanguage.&Office=&Office~!@#$&Biuro~!@#$Büro~!@#$
TdmLanguage.&Personel=&Personel~!@#$Personel~!@#$Betriebspersonal~!@#$
TdmLanguage.&Repairs=&Repairs~!@#$Naprawy~!@#$Reparaturen~!@#$
TdmLanguage.&Reports=&Reports~!@#$Raporty~!@#$Berichte~!@#$
TdmLanguage.&System=&System~!@#$&System~!@#$&System~!@#$
TdmLanguage.&Tools=&Tools~!@#$Narzędzia~!@#$Werkzeuge~!@#$
TdmLanguage.&Window=&Window~!@#$Okno~!@#$Fenster~!@#$
TdmLanguage.A&sset consumption=A&sset consumption~!@#$Użycie środków trwałych~!@#$Auszehrung des Eigenkapitals~!@#$
TdmLanguage.C&atalogs=C&atalogs~!@#$Katalogi~!@#$Kataloge~!@#$
TdmLanguage.C&onfiguration=C&onfiguration~!@#$Konfiguracja~!@#$Konfiguration~!@#$
TdmLanguage.Creating main form...=Creating main form...~!@#$Tworzenie głównego okna...~!@#$Hauptfensterherstellung...~!@#$
TdmLanguage.Database: =Database: ~!@#$Baza danych:~!@#$Datenbank:~!@#$
TdmLanguage.Internal ordered=Internal ordered~!@#$~!@#$~!@#$
TdmLanguage.Internal unexpected=Internal unexpected~!@#$~!@#$~!@#$
TdmLanguage.Loading packages...=Loading packages...~!@#$Ladowanie pakietów...~!@#$Paket wird geladen...~!@#$
TdmLanguage.Opening connection...=Opening connection...~!@#$Otwieranie połączenia...~!@#$Verbindungsaufbau...~!@#$
TdmLanguage.Please wait...=Please wait...~!@#$Proszę czekać...~!@#$Bitte warten...~!@#$
TdmLanguage.R&epair plans=R&epair plans~!@#$Plany napraw~!@#$Reparaturplan~!@#$
TdmLanguage.Searching...=Searching...~!@#$Wyszukiwanie...~!@#$Suche...~!@#$
TdmLanguage.Starting application...=Starting application...~!@#$Uruchomianie aplikacji...~!@#$Programmstart....~!@#$
TdmLanguage.User: =User: ~!@#$Użytkownik:~!@#$Benutzer:~!@#$

After I start the application none of the strings are found and the file looks like this:


[Language names - for internal use only!]
Language_1=English
Language_2=Polski
Language_3=Deutsch

[OPTIONS]
DELIMITER=~!@#$

[Strings]
r: ~!@#$Użytkownik:~!@#$Benutzer:~!@#$=
r: ~!@#$Użytkownik:~!@#$Benutzer:~!@#$=
r: ~!@#$Użytkownik:~!@#$Benutzer:~!@#$=
r:~!@#$=
TdmLanguage.&Asset=&Asset~!@#$Środki trwałe~!@#$Inventar~!@#$
TdmLanguage.&Companies=&Companies~!@#$Firmę~!@#$Firmen~!@#$
TdmLanguage.&Configuration=&Configuration~!@#$Konfiguracja~!@#$Konfiguration~!@#$
TdmLanguage.&Help=&Help~!@#$&Pomoc~!@#$&Hilfe~!@#$
TdmLanguage.&Machine base=&Machine base~!@#$Baza sprzętowa~!@#$Grundmaschine~!@#$
TdmLanguage.&Office=&Office~!@#$&Biuro~!@#$Büro~!@#$
TdmLanguage.&Personel=&Personel~!@#$Personel~!@#$Betriebspersonal~!@#$
TdmLanguage.&Repairs=&Repairs~!@#$Naprawy~!@#$Reparaturen~!@#$
TdmLanguage.&Reports=&Reports~!@#$Raporty~!@#$Berichte~!@#$
TdmLanguage.&System=&System~!@#$&System~!@#$&System~!@#$
TdmLanguage.&Tools=&Tools~!@#$Narzędzia~!@#$Werkzeuge~!@#$
TdmLanguage.&Window=&Window~!@#$Okno~!@#$Fenster~!@#$
TdmLanguage.A&sset consumption=A&sset consumption~!@#$Użycie środków trwałych~!@#$Auszehrung des Eigenkapitals~!@#$
TdmLanguage.C&atalogs=C&atalogs~!@#$Katalogi~!@#$Kataloge~!@#$
TdmLanguage.C&onfiguration=C&onfiguration~!@#$Konfiguracja~!@#$Konfiguration~!@#$
TdmLanguage.Creating main form...=Creating main form...~!@#$~!@#$~!@#$
TdmLanguage.Database: =Database: ~!@#$Baza danych:~!@#$Datenbank:~!@#$
TdmLanguage.Internal ordered=Internal ordered~!@#$~!@#$~!@#$
TdmLanguage.Internal unexpected=Internal unexpected~!@#$~!@#$~!@#$
TdmLanguage.Loading packages...=Loading packages...~!@#$~!@#$~!@#$
TdmLanguage.Opening connection...=Opening connection...~!@#$~!@#$~!@#$
TdmLanguage.Please wait...=Please wait...~!@#$Proszę czekać...~!@#$Bitte warten...~!@#$
TdmLanguage.R&epair plans=R&epair plans~!@#$Plany napraw~!@#$Reparaturplan~!@#$
TdmLanguage.Searching...=Searching...~!@#$Wyszukiwanie...~!@#$Suche...~!@#$
TdmLanguage.Starting application...=Starting application...~!@#$~!@#$~!@#$
TdmLanguage.User: =User: ~!@#$Użytkownik:~!@#$Benutzer:~!@#$




r: ~!@#$Użytkownik:~!@#$Benutzer:~!@#$



Any idea what I am doing wrong?

Thanks
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Oct 14, 2004 8:39 am    Post subject: Reply with quote

Nothing, there is just a bug in our source. To fix it just open SICOMP.PAS and find the lines:

Code:
//    AStream.Size := 0;
    AStream.Position := 0;

change them to:

Code:
    AStream.Size := 0;
    AStream.Position := 0;

and re-compile your project and packge.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Thu Oct 14, 2004 8:39 am    Post subject: Reply with quote

Sorry for this!
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