On 09.09.2011 18:27, Sergei Gorelkin wrote:
09.09.2011 18:36, Martin пишет:
fpc recently added the ability to translate
const Foo: String = resourcestring;
if resourcestring changes so does Foo
Any way to work around this?
Probably only by duplicating the literal value which is used to
initialize.
because in C:\lazarus_latest\components\synedit\syneditstrconst.pp
there are a lot of strings initialized that way with the intend of
the old behaviour => keep an
untranslated copy.
Also: Is that intended for typed const?
Foo in above could have been changed by user in the meantime.
Yes, trying to be Delphi-compatible. In Delphi, such consts are
translated. Delphi translates them once during initialization, but in
FPC this is impossible to do because translation typically happens
later, so the only way is to hook into SetResourceStrings.
Personally I don't think this is a valuable feature, but the matter of
fact is all Delphi features are implemented in FPC sooner or later -
so why not to do it sooner...
Regards,
Sergei
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel
This being translated always and is Delphi compatible
resourcestring
sString1='Some localizable constant'
sString2='Another localizable constant'
const
sStrings:array[0..1] of PResStringRec=(@sString1,@sString2);
Regards,
Anton
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel