brookmessageshandler_ptbr.pas 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. (*
  2. Brook for Free Pascal
  3. Copyright (C) 2014-2019 Silvio Clecio
  4. See the file LICENSE.txt, included in this distribution,
  5. for details about the copyright.
  6. This library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. *)
  10. { Messages (pt-BR) handler unit. }
  11. unit BrookMessagesHandler_ptBR;
  12. {$i brook.inc}
  13. interface
  14. uses
  15. BrookMessages_ptBR, BrookException, BrookMessages, BrookClasses;
  16. type
  17. { Handles exceptions for @link(TBrookMessagesHandler_ptBR). }
  18. EBrookMessagesHandler_ptBR = class(EBrook);
  19. { Is a metaclass for @link(TBrookMessagesHandler_ptBR) class. }
  20. TBrookMessagesHandler_ptBRClass = class of TBrookMessagesHandler_ptBR;
  21. { Handles the pt-BR messages. }
  22. TBrookMessagesHandler_ptBR = class(TBrookComponent)
  23. private
  24. function GetLocale: string;
  25. public
  26. { Translates all the internal messages of the framework. }
  27. procedure Translate;
  28. { Shows the default locale selected to the framework. }
  29. property Locale: string read GetLocale;
  30. end;
  31. implementation
  32. { TBrookMessagesHandler_ptBR }
  33. function TBrookMessagesHandler_ptBR.GetLocale: string;
  34. begin
  35. Result := BrookMessages.SBrookDefaultLocale;
  36. end;
  37. procedure TBrookMessagesHandler_ptBR.Translate;
  38. begin
  39. BrookMessages_ptBR.BrookTranslate;
  40. BrookMessages_ptBR.BrookHttpTranslate;
  41. end;
  42. end.