unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants,inifiles, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
RBEnglish: TRadioButton;
RBTw: TRadioButton;
ComboBox1: TComboBox;
Button1: TButton;
Label1: TLabel;
procedure RBEnglishClick(Sender: TObject);
procedure RBTwClick(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Myini:TiniFile;
implementation
{$R *.dfm}
procedure TForm1.RBEnglishClick(Sender: TObject);
var
name:String;
begin
name:=ExtractFilePath(Paramstr(0))+'english.ini';
Myini:=TiniFile.Create(name);
GroupBox1.Caption:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Caption:=Myini.ReadString('language','RBEnglish','');
RBTw.Caption:=Myini.ReadString('language','RBTw','');
Button1.Caption:=Myini.ReadString('language','Button1','');
Label1.Caption:=Myini.ReadString('language','Label1','');
GroupBox1.Hint:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Hint:=Myini.ReadString('language','RBEnglish','');
RBTw.Hint:=Myini.ReadString('language','RBTw','');
Button1.Hint:=Myini.ReadString('language','Button1','');
Label1.Hint:=Myini.ReadString('language','Label1','');
ComboBox1.Text:='English';
end;
procedure TForm1.RBTwClick(Sender: TObject);
var
name:String;
begin
name:=ExtractFilePath(Paramstr(0))+'TaiWan.ini';
Myini:=TiniFile.Create(name);
GroupBox1.Caption:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Caption:=Myini.ReadString('language','RBEnglish','');
RBTw.Caption:=Myini.ReadString('language','RBTw','');
Button1.Caption:=Myini.ReadString('language','Button1','');
Label1.Caption:=Myini.ReadString('language','Label1','');
GroupBox1.Hint:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Hint:=Myini.ReadString('language','RBEnglish','');
RBTw.Hint:=Myini.ReadString('language','RBTw','');
Button1.Hint:=Myini.ReadString('language','Button1','');
Label1.Hint:=Myini.ReadString('language','Label1','');
ComboBox1.Text:='TaiWan';
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
var
name:String;
begin
if ComboBox1.Text='English' then
begin
name:=ExtractFilePath(Paramstr(0))+'english.ini';
Myini:=TiniFile.Create(name);
GroupBox1.Caption:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Caption:=Myini.ReadString('language','RBEnglish','');
RBTw.Caption:=Myini.ReadString('language','RBTw','');
Button1.Caption:=Myini.ReadString('language','Button1','');
Label1.Caption:=Myini.ReadString('language','Label1','');
GroupBox1.Hint:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Hint:=Myini.ReadString('language','RBEnglish','');
RBTw.Hint:=Myini.ReadString('language','RBTw','');
Button1.Hint:=Myini.ReadString('language','Button1','');
Label1.Hint:=Myini.ReadString('language','Label1','');
end
else
begin
name:=ExtractFilePath(Paramstr(0))+'TaiWan.ini';
Myini:=TiniFile.Create(name);
GroupBox1.Caption:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Caption:=Myini.ReadString('language','RBEnglish','');
RBTw.Caption:=Myini.ReadString('language','RBTw','');
Button1.Caption:=Myini.ReadString('language','Button1','');
Label1.Caption:=Myini.ReadString('language','Label1','');
GroupBox1.Hint:=Myini.ReadString('language','GroupBox1','');
RBEnglish.Hint:=Myini.ReadString('language','RBEnglish','');
RBTw.Hint:=Myini.ReadString('language','RBTw','');
Button1.Hint:=Myini.ReadString('language','Button1','');
Label1.Hint:=Myini.ReadString('language','Label1','');
end;
end;
end.