[fpc-pascal] How to get the current translation of a resource string?

Michael Van Canneyt michael at freepascal.org
Wed Dec 2 13:30:13 CET 2020



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...

Michael.


More information about the fpc-pascal mailing list