Localization vs Localisation

If for Americans, use -ize and remember to change all the -our endings into -or.

If for British readers, use -ise or -ize.

Advertisements

Localization of MessageDlg in Delphi

Built-in MessageDlg function shows texts such as Yes, No, Confirmation only in English.

function MyMessageDlg(CONST Msg: string; DlgTypt: TmsgDlgType; button: TMsgDlgButtons;
 Caption: ARRAY OF string; dlgcaption: string): Integer;
var
 aMsgdlg: TForm;
 i: Integer;
 Dlgbutton: Tbutton;
 Captionindex: Integer;
begin
 aMsgdlg := createMessageDialog(Msg, DlgTypt, button);
 aMsgdlg.Caption := dlgcaption;
//aMsgdlg.BiDiMode := bdRightToLeft;
 Captionindex := 0;
 for i := 0 to aMsgdlg.componentcount - 1 Do
 begin
 if (aMsgdlg.components[i] is Tbutton) then
 Begin
 Dlgbutton := Tbutton(aMsgdlg.components[i]);
 if Captionindex <= High(Caption) then
 Dlgbutton.Caption := Caption[Captionindex];
 inc(Captionindex);
 end;
 end;
 Result := aMsgdlg.Showmodal;
end;

Get ShellExecute Error in Delphi

ExecuteResult:=ShellExecute(Handle, 'open', PChar(filename), nil, nil, SW_HIDE);

case ExecuteResult of
 0 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The operating system is out of memory or resources.');
 2 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The specified file was not found.');
 3 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The specified path was not found.');
 5 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Windows 95 only: The operating system denied access to the specified file.');
 8 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Windows 95 only: There was not enough memory to complete the operation.');
 10 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Wrong Windows version.');
 11 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).');
 12 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Application was designed for a different operating system.');
 13 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Application was designed for MS-DOS 4.0.');
 15 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Attempt to load a real-mode program.');
 16 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Attempt to load a second instance of an application with non-readonly data segments.');
 19 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Attempt to load a compressed application file.');
 20 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Dynamic-link library (DLL) file failure.');
 26 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': A sharing violation occurred.');
 27 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The filename association is incomplete or invalid.');
 28 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The DDE transaction could not be completed because the request timed out.');
 29 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The DDE transaction failed.');
 30 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': The DDE transaction could not be completed because other DDE transactions were being processed.');
 31 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': There is no application associated with the given filename extension.');
 32 : ShowMessage('Error ' + IntToStr(ExecuteResult) + ': Windows 95 only: The specified dynamic-link library was not found.');
 end;

Inno Setup Languages

[Languages]
 Name: "en"; MessagesFile: "compiler:Default.isl"
 Name: "af"; MessagesFile: "compiler:Languages\Afrikaans.isl"
 Name: "bg"; MessagesFile: "compiler:Languages\Bulgarian.isl"
 Name: "bs"; MessagesFile: "compiler:Languages\Bosnian.isl"
 Name: "cs"; MessagesFile: "compiler:Languages\Czech.isl"
 Name: "da"; MessagesFile: "compiler:Languages\Danish.isl"
 Name: "de"; MessagesFile: "compiler:Languages\German.isl"
 Name: "el"; MessagesFile: "compiler:Languages\Greek.isl"
 Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl"
 Name: "fa"; MessagesFile: "compiler:Languages\Farsi.isl"
 Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl"
 Name: "fr"; MessagesFile: "compiler:Languages\French.isl"
 Name: "hi"; MessagesFile: "compiler:Languages\Hindi.islu"
 Name: "hr"; MessagesFile: "compiler:Languages\Croatian.isl"
 Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl"
 Name: "id"; MessagesFile: "compiler:Languages\Indonesian-5.1.11.isl"
 Name: "it"; MessagesFile: "compiler:Languages\Italian.isl"
 Name: "ka"; MessagesFile: "compiler:Languages\Georgian.islu"
 Name: "lv"; MessagesFile: "compiler:Languages\Latvian.isl"
 Name: "ne"; MessagesFile: "compiler:Languages\Nepali.islu"
 Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl"
 Name: "no"; MessagesFile: "compiler:Languages\Norwegian.isl"
 Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl"
 Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl"
 Name: "ro"; MessagesFile: "compiler:Languages\Romanian.isl"
 Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
 Name: "sk"; MessagesFile: "compiler:Languages\Slovak.isl"
 Name: "sr"; MessagesFile: "compiler:Languages\Serbian.isl"
 Name: "tr"; MessagesFile: "compiler:Languages\Turkish.isl"
 Name: "vi"; MessagesFile: "compiler:Languages\Vietnamese.isl"
 Name: "zh"; MessagesFile: "compiler:Languages\ChineseSimp-12-5.1.11.isl"

Get Windows Language in English

function GetLocaleInformation(Flag: Integer): string;
var
 pcLCA: array [0..20] of Char;
begin
 if GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, Flag, pcLCA, 19) <= 0 then
 pcLCA[0] := #0;
 Result := pcLCA;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
 ShowMessage(GetLocaleInformation(LOCALE_SENGLANGUAGE));
end;

Result are like:

French

German

Japanese

kSign and Inno Setup Configuration

In Inno Setup:

Tools->Configure Sign Tools…

Add New:

Name: mysigntool

Value: “C:\Program Files (x86)\kSign\signtool.exe” sign /f “C:\Program Files (x86)\kSign\MyCertificate.pfx” /t http://timestamp.verisign.com/scripts/timstamp.dll $f

OR

Value: “C:\Program Files (x86)\kSign\signtool.exe” sign /f “C:\Program Files (x86)\kSign\MyCertificate.pfx” /p MYPASSWORD /t http://timestamp.verisign.com/scripts/timstamp.dll $f

[Setup]
SignTool=mysigntool