<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">03.02.2018 13:05, Любомир Василев
      пишет:<br>
    </div>
    <blockquote type="cite"
      cite="mid:3f294fed-316d-84b5-c255-b5e0d35f2d6a@abv.bg">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p><font size="-1">Hi, Pavel<br>
        </font></p>
      <p><font size="-1">I do not know if Qt directly supports such a
          thing (someone else could comment), but I believe you can
          write a simple function for that. Something like:</font></p>
      <tt><font size="-1">void logAndGUI(const std::string& text)</font></tt><br>
      <tt><font size="-1">{</font></tt><br>
      <tt><font size="-1">    TO_LOG << text;</font></tt><br>
      <tt><font size="-1">    TO_GUI << tr(text);</font></tt><br>
      <tt><font size="-1">}</font></tt>
      <p><font size="-1">If you need arguments, that would require a bit
          more code but it is doable.<br>
        </font></p>
    </blockquote>
    <span id="result_box" class="" lang="en"><span class="">For one
        phrase this is quite acceptable, but I now have about ten of
        them, in the future there will be more.</span></span><br>
    <br>
    <blockquote type="cite"
      cite="mid:3f294fed-316d-84b5-c255-b5e0d35f2d6a@abv.bg">
      <p><font size="-1"> </font></p>
      <p><font size="-1">Good luck,</font></p>
      <p><font size="-1">Lyubomir Vasilev<br>
        </font></p>
      <br>
      <div class="moz-cite-prefix">На 3.02.2018 в 11:48, Карелин Павел
        написа:<br>
      </div>
      <blockquote type="cite"
        cite="mid:d29e1a71-dfd7-9b49-be11-467d9fc86f42@yandex.ru">
        <meta http-equiv="content-type" content="text/html;
          charset=utf-8">
        Hi,<br>
        <br>
        I ran into an unexpected problem: I need to output a phrase to
        the log file and be displayed in messages for the user. In the
        log file, the phrase should be without translation, but in the
        message for the user with the translation. <br>
        Is it possible to do this using only one instance of the phrase?
        Or do I have to duplicate the phrase?<br>
        For example:<br>
          TO_LOG << "Hello world" <br>
          TO_GUI  << tr("Hello world")   // Duplication<br>
        <br>
        <br>
        <div class="moz-signature"><font face="Arial"> --<br>
            BR, Pavel Karelin<br>
            <br>
          </font></div>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Localization mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Localization@qt-project.org" moz-do-not-send="true">Localization@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/localization" moz-do-not-send="true">http://lists.qt-project.org/mailman/listinfo/localization</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Localization mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Localization@qt-project.org">Localization@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/localization">http://lists.qt-project.org/mailman/listinfo/localization</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>