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 

Add LAnguage at runtime

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



Joined: 11 Mar 2005
Posts: 20

PostPosted: Mon Jul 11, 2005 10:00 am    Post subject: Add LAnguage at runtime Reply with quote

Hi there,

simple question;
How to add language at runtime ?

simple answer
?

Thanks for your help

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


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Mon Jul 11, 2005 11:16 am    Post subject: Reply with quote

Delphi:
siLangDispatcher.NumOfLanguages := siLangDispatcher.NumOfLanguages + 1;

C++Builder:
siLangDispatcher.NumOfLanguages = siLangDispatcher.NumOfLanguages + 1;

Is this enough? Wink
Back to top
View user's profile Send private message
mediatech



Joined: 11 Mar 2005
Posts: 20

PostPosted: Tue Jul 12, 2005 4:25 am    Post subject: Reply with quote

isiticov wrote:
Delphi:
siLangDispatcher.NumOfLanguages := siLangDispatcher.NumOfLanguages + 1;

C++Builder:
siLangDispatcher.NumOfLanguages = siLangDispatcher.NumOfLanguages + 1;

Is this enough? Wink



So far it works fine, another language is added, but next question; How to rename the new language, if im using the following code, nothing happens, the new language appears as "Language N...", even if im saving the file, see following code;
...
...
...
LangDispatcher.NumOfLanguages:= LangDispatcher.NumOfLanguages+1;
LangDispatcher.LangNames[LangDispatcher.NumOfLanguages-1]:= 'Test';
LangDispatcher.SaveAllToFile(LangDispatcher.FileName, sLangDelimiter);...
...
...
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2097

PostPosted: Tue Jul 12, 2005 7:03 am    Post subject: Reply with quote

You can try the following:
Code:
var
   Lst: TStringList;
begin
  siLangDispatcher1.NumOfLanguages := siLangDispatcher1.NumOfLanguages + 1;
  Lst := TStringList.Create;
  try
    Lst.Assign(siLangDispatcher1.LangNames);
    Lst[Lst.Count - 1] := 'New Language Name';
    siLangDispatcher1.LangNames := Lst;
  finally
    Lst.Free;
  end;
end;
Back to top
View user's profile Send private message
mediatech



Joined: 11 Mar 2005
Posts: 20

PostPosted: Tue Jul 12, 2005 10:47 am    Post subject: Reply with quote

isiticov wrote:
You can try the following:
Code:
var
   Lst: TStringList;
begin
  siLangDispatcher1.NumOfLanguages := siLangDispatcher1.NumOfLanguages + 1;
  Lst := TStringList.Create;
  try
    Lst.Assign(siLangDispatcher1.LangNames);
    Lst[Lst.Count - 1] := 'New Language Name';
    siLangDispatcher1.LangNames := Lst;
  finally
    Lst.Free;
  end;
end;


Hey,

that works fine !!!

Thank you

Andreas
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