multi language for my program

I make program and I want to let the user to select his language(english,arabic)...
I know some of programs store the objects caption in external ini file....but how ?
sal1150Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

geobulCommented:
Hi,

Search for 'International Applications' in your Delphi help and read all topics related to that. This issue is neither that simple to be explained in a few words nor a piece of source code that can be posted here. This is the standard Windows way of internationalization (using resources not ini files).

Regards, Geo
GloomyFriarCommented:
>I know some of programs store the objects caption in external ini file....but how ?
For each language create the ini-file (for example engl.ini, turk.ini, ...)
In the files for each control write a text. For example:
[buttons]
button1caption = 'My button'
...

At runtime load the strings to the controls.
kacorretiredCommented:
Hi sal1150,
try to use resource strings. Resource strings are stored as resources and linked into the executable or library so that they can be modified without recompiling the program.

with best regards

Janos
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

AFZDeveloperCommented:
try this:
//-------------------------------------
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, INIFiles,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button2: TButton;
    Button1: TButton;
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button2Click(Sender: TObject);
var
  INIFile: TIniFile;
begin
  INIFile := TInifile.Create(ExtractFilePath(Application.ExeName)+'\myconfig.ini');
  INIFile.WriteString('english','button1','english button');
  INIFile.WriteString('arabic' ,'button1','arabic button');
  INIFile.Free;
end;


procedure TForm1.FormCreate(Sender: TObject);
var
  INIFile: TIniFile;
  s:string;
begin
  //------------- for help you -----------------
  Button2.Caption:='Write To INI File';
  //--------------------------------------------
  INIFile := TInifile.Create(ExtractFilePath(Application.ExeName)+'\myconfig.ini');
  if MessageDlg('language is arabic?', mtConfirmation, [mbYes, mbNo], 0) = mrYes
     then begin
            S:=INIFile.ReadString('arabic','button1','no define arabic');
            Button1.Caption:=s;
          end
     else begin
            S:=INIFile.ReadString('english','button1','no define english');
            Button1.Caption:=s;
          end;
  INIFile.Free;
end;

end.
//-------------------------------------------------------
press button2 to create ini file.
jgilmCommented:
My smaller programs use the INI method to store text. If this is a big application and you have the budget, I would recommend Multilizer. I'm using it now and it takes care of most of my problems. However, we have a huge application and it must support more than 10 languages, so the expense was not much of a consideration.
ccrdudeCommented:
Resource strings may be the standard way, but they're neither easy for the translator nor small.
And AFZDeveloper's method isn't very comfortable as it needs a separate line for each control... I started that way, but it's not really practicable...

So I've written my own unit that iterates through the whole control and saves/loads fields based on their control names and text properties. Actually quite simple and reliable (though you should use actions for all active controls, like menu items and buttons, to avoid problems when moving them).
Give me a day or two and I'll upload the code for that one...
swift99Commented:
My task in internationalization is that concurrent users need to see their sessions in their own languages.  For this situation, I keep the language preference as a part of the user's tag information, and keep all of my textual data in files (resource, INI, text, XML - your choice).  When form 20000 is loaded for english language, the controls are configured according to the data in the file frm-20000-009.ini (or res or xml or txt).

Context sensitive help is stored in files hlp-20000-009.rtf
tommyliuCommented:
Listening ...
swift99Commented:
My task in internationalization is that concurrent users need to see their sessions in their own languages.  For this situation, I keep the language preference as a part of the user's tag information, and keep all of my textual data in files (resource, INI, text, XML - your choice).  When form 20000 is loaded for english language (language code 9 per Windows standards), the controls are configured according to the data in the file frm-20000-009.ini (or res or xml or txt).

Context sensitive help is stored in files hlp-20000-009.rtf, where 20000 represents the help context.

The use of external text and RTF files means that I can add any language to my supported base without ever touching the code.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
swift99Commented:
sorry about the double post - I double clicked.   :o(
sal1150Author Commented:
hi ccrdude...
 I am waiting u..................
SandyXPCommented:
hey. so if you want multi-language program, then go get SML-PACK (http://www.sunisoft.com/smlpack/index.htm). It's the newest version(1.4) but it's trial and i don't have the crack. But take this version: (i think it's older, but it works well) - and it is cracked, it is not trial:
http://6cxp-ilc.idilis.ro/smlpack.zip

Hope you enjoy it, it's simple to use:)

SandyXP
SandyXPCommented:
by the way, at http://www.sunisoft.com/suipack/index.htm, you can get the SuiPack 4 Trial .. i think i will find the crack for it soon - it gives a super-interface to the program : windowsXP-like or even better, it has also a cool mac theme. Try it!
swift99Commented:
off topic -> "Cracking" software hurts us all.  If you can't use a tool legally, then find another tool.
sal1150Author Commented:
hi SandyXP
it is trial...!!
kacorretiredCommented:
Hi everybody,
I looked at the http://www.sunisoft.com/suipack/index.htm site, and it is really very cheap!!! And you can download a free trial version.

wbr Janos
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.