Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Detect active language



Permlink Replies: 1 - Last Post: Nov 12, 2015 8:48 PM Last Post By: Jaakko Salmenius Threads: [ Previous | Next ]
Valgarður Guðjó...

Posts: 4
Registered: 4/3/09
Detect active language
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2015 8:06 AM
I am using Delphi's language options, which works fine for forms, but is there a way to detect active language in my code (.pas)?
Jaakko Salmenius

Posts: 1
Registered: 1/21/98
Re: Detect active language
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 12, 2015 8:48 PM   in response to: Valgarður Guðjó... in response to: Valgarður Guðjó...
If you use Delphi 2010 or later you can use the following code:

function GetActiveLanguage: String;
var
applicationName: array [0..MAX_PATH] of Char;
begin
GetModuleFileName(0, applicationName, Length(applicationName));
Result := ExtractFileExt(GetResourceModuleName(applicationName, applicationName));
Delete(Result, 1, 1);
end;
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02