Recent

Author Topic: Exception messages ¿only in english lang?  (Read 5018 times)

u2o

  • Jr. Member
  • **
  • Posts: 72
  • No message
Exception messages ¿only in english lang?
« on: May 29, 2013, 12:39:18 pm »
Code sample:

Code: [Select]
    if (sSpecialApp <> '') then begin
      try
        Process1.Executable := sSpecialApp;
        Process1.Options := Process1.Options + [poNoConsole];
        Application.ProcessMessages;
        Process1.Execute;
      except
        on e: Exception do begin
          MessageDlg('Lanzador', 'Error al ejecutar la aplicación definida...' + #13#10 + '  --> ' + e.message, mtWarning, [mbOK], 0);
          Exit;
        end;
      end;
    end;


The button caption is translated to spanish (with Translations.TranslateUnitResourceStrings), but no affect Exception Messages.

Is there any method?
« Last Edit: January 18, 2014, 07:52:33 pm by u2o »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Exception messages ¿only in english lang?
« Reply #1 on: May 29, 2013, 12:49:37 pm »
Your Spanish message is given as a literal string, and not converted to and referred to as a resourcestring, so is not available for substitution by a translated string.

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Exception messages ¿only in english lang?
« Reply #2 on: May 29, 2013, 12:52:33 pm »
First error: definida...' ('')
and please, be more specific, OS, Lazarus ver, etc.
p.s. poWaitOnExit?
« Last Edit: May 29, 2013, 12:55:09 pm by exdatis »

u2o

  • Jr. Member
  • **
  • Posts: 72
  • No message
Re: Exception messages ¿only in english lang?
« Reply #3 on: May 29, 2013, 02:07:00 pm »
Hi All!

Your Spanish message is given as a literal string, and not converted to and referred to as a resourcestring, so is not available for substitution by a translated string.

@howardpc :
    How to use resourcestring?
    ps: I don't found all possible error numbers, returned by Exception for TProcess.

First error: definida...' ('')
and please, be more specific, OS, Lazarus ver, etc.
p.s. poWaitOnExit?

@exdatis:
    No problem with definida... See the picture attached, the message is showed.

    Windows 7 x86.
    Lazarus v1.0.8 ---- FPC v2.6.2 ---- SVN: 40573 ---- i386-win32-win32/win64

    No poWaitOnExit, only execute.

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: Exception messages ¿only in english lang?
« Reply #4 on: May 29, 2013, 02:12:58 pm »
Then the problem is in the executable?
Try to set a path (environment variables) of executable.
Regards

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis

u2o

  • Jr. Member
  • **
  • Posts: 72
  • No message
Re: Exception messages ¿only in english lang?
« Reply #6 on: May 29, 2013, 02:29:41 pm »
Apologies, I write in the wrong forum. If any admin sees it, please move the topic.

@exdatis:
    I thought that by using the files 'po' to translate, all internal messages of Lazarus Runtime apply the same method... But not so.

    The process is executed correctly, I only need translate the messages in errors case.
« Last Edit: May 29, 2013, 02:31:30 pm by u2o »


u2o

  • Jr. Member
  • **
  • Posts: 72
  • No message
Re: Exception messages ¿only in english lang?
« Reply #8 on: January 06, 2014, 08:27:22 am »
Hi! After some time, I found the error.

The problem: I'm doing separate projects, and once completed all the necessary functions for each interface and works ok (there are 44 forms in the project!), I add the forms by the clause "uses" and manually open the forms from a TMainMenu. So I do not add the forms through the pincipal project.

I think I must be forgetting some other definition of variables. But even I can not find the solution (for  now).  I'll post if I do.

 

TinyPortal © 2005-2018