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 

How can I get the language under IOS and Android

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



Joined: 04 Mar 2016
Posts: 4

PostPosted: Tue Aug 30, 2016 12:13 pm    Post subject: How can I get the language under IOS and Android Reply with quote

Under Windows I can get the LangId:

procedure TForm1.FormCreate(Sender: TObject);
var
LangID: DWORD;
begin
LangID := GetUserDefaultLangID;
case Byte(LangID and $03FF) of
LANG_ENGLISH: siLangDispatcher1.ActiveLanguage := 1;
LANG_GERMAN: siLangDispatcher1.ActiveLanguage := 2;
LANG_FRENCH: siLangDispatcher1.ActiveLanguage := 3;
else
siLangDispatcher1.ActiveLanguage := 1;
end;

Is there a way to get LANG_ENGLISH, LANG_GERMAN under IOS and Android?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Sat Sep 10, 2016 3:29 am    Post subject: Reply with quote

Hello,

SysLocale global variable includes this information under any OS.

Code:

{ System Locale information record }
  TSysLocale = packed record
    DefaultLCID: TLocaleID;
    PriLangID: Integer;
    SubLangID: Integer;
    FarEast: Boolean;
    MiddleEast: Boolean;
  end;


so the sample code would be:

Code:

case SysLocale.PriLangID of
 LANG_ENGLISH: siLangDispatcher1.ActiveLanguage := 1;
 LANG_GERMAN: siLangDispatcher1.ActiveLanguage := 2;
 LANG_FRENCH: siLangDispatcher1.ActiveLanguage := 3;
 else
 siLangDispatcher1.ActiveLanguage := 1;



FAQ: http://www.tsilang.com/delphiglobalizationtool_faq.html#18
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