Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:28:52+00:00 2026-05-27T02:28:52+00:00

I need to translate a program in others languages, actually I have the same

  • 0

I need to translate a program in others languages, actually I have the same program in 3 languages (english, spanish, portuguese), but I translated, recompiled, and I have 3 separate executables. And add more languages, and keep links, and adding new functions is driving me crazy.

So now I decided to keep a single executable, and a external language file, so adding new languages does not need recompiling, just editing the language file with a text editor, and everything is ok.

I want to keep all languages in a single external file. like international.lang

[portuguese]
greeting="Bem-vindo"

[spanish]
greeting="Ben venido"

if the file international.lang is not there, or your language is not on the file, the program will launch in english by default, with no errors. Just like most multi-languages programas based on resources.

So the question is, how detect the Windows language in delphi?
Any thoughts on my approach?
There is any way to replace all captions on dialogs programaticly?

ps: I’m using delphi7, and I can’t find any component that is free that is good.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:28:53+00:00Added an answer on May 27, 2026 at 2:28 am

    You can use the GetSystemDefaultLCID function to get the locale identifier and then use the VerLanguageName function to resolve the language associated name. or use the GetLocaleInfo function

    Check this sample

    {$APPTYPE CONSOLE}
    
    uses
      Windows,
      SysUtils;
    
    
    procedure Test_VerLanguageName;
    var
      wLang : LangID;
      szLang: Array [0..254] of Char;
    begin
      wLang := GetSystemDefaultLCID;
      VerLanguageName(wLang, szLang, SizeOf(szLang));
      Writeln(szLang);
    end;
    
    procedure Test_GetLocaleInfo;
    var
      Buffer : PChar;
      Size : integer;
    begin
      Size := GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, nil, 0);
      GetMem(Buffer, Size);
      try
        GetLocaleInfo (LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, Buffer, Size);
        Writeln(Buffer);
      finally
        FreeMem(Buffer);
      end;
    end;
    
    begin
      try
        Test_VerLanguageName;
        Test_GetLocaleInfo;
    
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
      Readln;
    end.
    

    Note : Starting with Windows Vista exists new functions to get the same locale information, check these functions GetLocaleInfoEx, GetUserDefaultLocaleName and GetSystemDefaultLocaleName

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to have our apps be translated into other languages. This entails renaming
I need to translate what is commented within the method, to assembler. I have
I have a case where I need to translate (lookup) several values from the
I have a task where I need to translate a DataTable to a two-dimensional
I have a code that need to be translated from C to Cpp, and
I have a program that installs on the English version of vista just fine
I don't want an automated solution. When you have to translate a program from
I need to translate SAP BO InfoView interface. The language we require doesn't have
If I need to translate my website in languages that I do not know,
I have four threads, and i need to translate the data among these threads,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.