[Solved] How to localize confirmation delete dialog? (TDBNavigator) lazarus / 16-Databases ---------------------------------------------------------------------- tsr · 2016-03-08 20:45 How to localize/translate confirmation delete dialog of DBNavigator? If shows when ConfirmDelete property is set to true and I try to delete a record. ---------------------------------------------------------------------- anis2505 · 2016-03-08 20:55 Hi   , First set ConfirmDelete to false Second on the BeforeAction Event of the DBNavigator Code: [Select]if Button = nbDelete then      begin           if MessageDlg('Your confirmation message', mtConfirmation, [mbYes,mbNo], 0) = mrNo then           begin                Abort;           end;      end; [code] Hope this helps regards ---------------------------------------------------------------------- tsr · 2016-03-08 21:22 Thank you sir! I confirm that it works. There is small detali that dialog caption is untranslated on my system but I found solution on my way: added ACaption (first parameter). Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i MessageDlg('Window caption', 'Your confirmation message', mtConfirmation, [mbYes,mbNo], 0) = mrNo ---------------------------------------------------------------------- tsr · 2016-03-11 15:23 My question comes back. In the dialog box are buttons "Yes" and "No". How to localize it? ---------------------------------------------------------------------- Bart · 2016-03-11 15:35 If you use the lclstrconst.xx.po (where xx is your language) (together with the translations unit) then all this should be localized. About the original question. If these strings aren't localized then feel free to supply a patch. Add the resourcestring to lclstrconsts unit. Rebuild the .po files. (There's a tool in ($Lazarus)/tools) Edit the pofile of your language to get the proper translation of the new resourcestring. Bart ---------------------------------------------------------------------- Windsurfer · 2016-03-11 15:46 There is an example called translation_demo, a wiki page: http://wiki.lazarus.freepascal.org/Getting_translation_strings_right with links at the bottom and a PoChecker package that could be useful be useful. ---------------------------------------------------------------------- tsr · 2016-03-11 22:04 You have given me very nice clues. Because LCL strings translation already exists (Polish) I only need to use it. Good materials on this wiki: http://wiki.lazarus.freepascal.org/Transl ations_/_i18n_/_localizations_for_programs - Added "DefaultTranslator" to program uses. - Enabled l18n in project options. - Copied "lclstrconsts.pl.po" file to "MyProjectDir/locale" directory and renamed that file to "MyProjectName.pl.po" then it works. Anyone knows how to use PO (or MO) file with LCL resourcestrings without renaming it? @anis2505: Your solution has en error. Question dialog about deleting appears and if I not select "Yes" but only close the dialog by "x" then deletion succeed. I have corrected it already. ---------------------------------------------------------------------- wp · 2016-03-11 22:38 Quote from: tsr on March 11, 2016, 11:04:29 pm- Copied "lclstrconsts.pl.po" file to "MyProjectDir/locale" directory and renamed that file to "MyProjectName.pl.po" then it works. Anyone knows how to use PO (or MO) file with LCL resourcestrings without renaming it? Should work without renaming: http://wiki.lazarus.freepascal.org/Step- by-step_instructions_for_creating_multi- language_applications#Strings_defined_by_the_LCL (Maybe you forgot to add "lclstrconsts" to the uses clause?) ---------------------------------------------------------------------- Bart · 2016-03-11 22:51 @wp: the actual program does not need to have lclstrstconsts in it's uses clause at all. Just load the proper lclstrconsts.xx.po and every LCL resource string will be translated (as long as the po file is up-to-date). Bart ---------------------------------------------------------------------- wp · 2016-03-11 23:01 Ah sure, stupid! I was testing the tutorial sample with a QuestionDlg and was using one of the strings in that unit. ---------------------------------------------------------------------- tsr · 2016-03-11 23:22 Thanks. It works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Translations.TranslateUnitResourceStrings('lclstrconsts', 'locale/lclstrconsts.pl.po');