Recent

Author Topic: Translation of dialog boxes to PT-BR  (Read 2327 times)

babycode

  • New Member
  • *
  • Posts: 17
Translation of dialog boxes to PT-BR
« on: May 03, 2024, 09:58:15 pm »
I translated the lazarus dialog boxes from the lclstrconsts.pas file into Português do Brasil. Anyone interested in using it just download the file from the repository: https://github.com/assisdantas/lclstrconsts-ptbr.
(Traduzi as caixas de diálogo do lazarus do arquivo lclstrconsts.pas para o português brasileiro. Quem tiver interesse em utilizá-lo basta baixar o arquivo do repositório)

Follow the steps:
  • Create a backup copy of the "lclstrconsts.pas" file present in the Lazarus installation directory (usually C:\lazarus\lcl);
  • Copy the translation file from the "pt-br" folder to the LCL directory (replace the file);
  • Start Lazarus and go to Tools > Build Lazarus;
  • Wait for lazarus to compile and the dialogues will be translated at the end.


wp

  • Hero Member
  • *****
  • Posts: 12072
Re: Translation of dialog boxes to PT-BR
« Reply #1 on: May 03, 2024, 11:25:51 pm »
Replacing units by translated versions is not the way the Lazarus translation system works. The minimum requirement to create a Portuguese-only application is to copy the file lclstrconsts.pt_BR.po from the ide/translations folder (in your Lazarus installation) (as well as other pt_BR.po files from other packages) into your project directory and to call TranslateUnitResourceStrings for each very early, e.g. in the initialization section of the main form unit.

Code: Pascal  [Select][+][-]
  1. var
  2.   PODir: String;
  3.  
  4. initialization
  5.   PODir := Application.Location;
  6.   TranslateUnitResourceStrings('lclstrconsts', PODir + 'lclstrconsts.pt_BR.po');  

See attached demo project.

babycode

  • New Member
  • *
  • Posts: 17
Re: Translation of dialog boxes to PT-BR
« Reply #2 on: May 04, 2024, 09:53:58 pm »
Thanks for the guidance wp didn't know this method.

 

TinyPortal © 2005-2018