Lazarus doesn't include Dutch translated messageboxes. So You get Dutch boxes with buttons like Yes, No, Cancel ipv Ja, Nee, Annuleren...
To eliminate that create a directory named locale and put in these 2 files:
lcldutch.lrs and lclstrconsts.nl.po
In the mainform add the following units to the interface:
LazFileUtils, IniFiles,
LazUtils, LCLType, LCLTranslator, Translations, LazUTF8, DefaultTranslator;
In the mainform.create add the following:
const
NLLang = 'nl';
FallBackLang = '';
LCLPOMask = 'lclstrconsts.%s.po';
LCLStrConsts = 'LCLStrConsts';
var
PODirectory : string;
begin
// You're own code
// ==========
// Vertaal messageboxen (buttons) naar Nederlands
// ===============================
appdir:=ExtractFilePath(Application.Location);
PODirectory := appdir+'locale\';
TranslateUnitResourceStrings(LCLStrConsts,PODirectory + LCLPOMask, NLLang, FallBackLang);
end;
// Testing:
// =====
Button1_click(Sender:TObject);
var
appini : string;
BoxStyle,
Reply : integer;
begin
appini:=ExtractFileNameWithoutExt(SaveDialog1.FileName)+'.dat';
BoxStyle := MB_ICONQUESTION + MB_YESNOCANCEL;
Reply := Application.MessageBox(pchar(ExtractFileName(appini)+' bestaat al. Doorgaan?'),'Overschrijven',BoxStyle);
if Reply<> IDYES then
begin
exit;
end;
end;
In the programming phase You need to keep this all the way so!!!
In the installation-phase You don't need this any more.
So You don't need to include the 'locale' directory.
HOWEVER (REMARK ;-)):
Within Internationalitation You've got English/American messageboxes with Dutch buttons, like this:
'Delete this file?','Ja, Nee, Annuleren' ipv Yes, No, Cancel...
The world turned around...
Love Lazarus...
How can I add lcldutch.lrs and lclstrconsts.nl.po to this forum-item?
[Edited to add code tags; please read
How to use the Forums.]