<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 09.09.2011 18:27, Sergei Gorelkin wrote:
    <blockquote cite="mid:4E6A305C.9040308@mail.ru" type="cite">09.09.2011
      18:36, Martin пишет:
      <br>
      <blockquote type="cite">fpc recently added the ability to
        translate
        <br>
        const Foo: String = resourcestring;
        <br>
        <br>
        if resourcestring changes so does Foo
        <br>
        Any way to work around this?
        <br>
        <br>
      </blockquote>
      Probably only by duplicating the literal value which is used to
      initialize.
      <br>
      <br>
      <blockquote type="cite">because in
        C:\lazarus_latest\components\synedit\syneditstrconst.pp
        <br>
        there are a lot of strings initialized that way with the intend
        of the old behaviour => keep an
        <br>
        untranslated copy.
        <br>
        <br>
        Also: Is that intended for typed const?
        <br>
        Foo in above could have been changed by user in the meantime.
        <br>
      </blockquote>
      <br>
      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.
      <br>
      <br>
      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...
      <br>
      <br>
      Regards,
      <br>
      Sergei
      <br>
      <br>
      _______________________________________________
      <br>
      fpc-devel maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://lists.freepascal.org/mailman/listinfo/fpc-devel">http://lists.freepascal.org/mailman/listinfo/fpc-devel</a>
      <br>
    </blockquote>
    <font face="Helvetica, Arial, sans-serif"><br>
      This being translated always and is Delphi compatible<br>
      <br>
    </font><font face="Helvetica, Arial, sans-serif">resourcestring <br>
        sString1='Some localizable constant'<br>
        sString2='Another localizable constant'<br>
      <br>
      const<br>
        sStrings:array[0..1] of PResStringRec=(@sString1,@sString2);</font><br>
    <br>
    Regards,<br>
    Anton<br>
  </body>
</html>