09.09.2011 18:36, Martin пишет:
Show quoted text 6 lines
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.
Show quoted text 6 lines
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