El 2/12/20 a les 13:30, Michael Van Canneyt via fpc-pascal ha escrit:


On Wed, 2 Dec 2020, Luca Olivetti via fpc-pascal wrote:

But the 'current translation' is simply the value of the resourcestring, so
you should not need to look it up ?

How?

I'm trying to detect this specific exception

      raise EInvalidOperation.Create(sCannotFocus);

(where sCannotFocus is defined in LCLStrConsts).

I tried

  if E is EInvalidOperation then
     if E.message=sCannotFocus

but it doesn't work (sCannotFocus holds the original, not the translated, string).

Seems like Lazarus is not using the regular resourcestrings then, because
the whole point of using resourcestrings is that their value is the
translated value...


Never mind, I was fooled by the debugger tool-tip, which shows the original definition and not the current value of the resourcestring :-(


Bye
--
Luca
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to