<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hallo Robert,<br>
    </p>
    Am 21.02.2017 um 11:44 schrieb Robert Helling:<br>
    <blockquote
      cite="mid:5824F147-3AE5-4BAF-BA49-23A896565A9C@atdotde.de"
      type="cite">
      <div class="">
        <div><br>
          <blockquote type="cite" class="">
            <div class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <blockquote
                  cite="mid:44D42C4C-572C-4300-974D-3DBB32B7ADCE@atdotde.de"
                  type="cite" style="font-family: Menlo-Regular;
                  font-size: 12px; font-style: normal;
                  font-variant-caps: normal; font-weight: normal;
                  letter-spacing: normal; orphans: auto; text-align:
                  start; text-indent: 0px; text-transform: none;
                  white-space: normal; widows: auto; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; background-color:
                  rgb(255, 255, 255);" class="">
                  <div class="">And as I said: I think it’s cleaner to
                    add an event to the dive rather than plot directly
                    to the profile. Simply use</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">
                    <pre class="" style="margin-top: 0px; margin-bottom: 0px;"><span class="" style="color: rgb(128, 128, 0);">struct</span><span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 0, 128);">event</span><span class="" style="color: rgb(192, 192, 192);"> </span>*add_event(<span class="" style="color: rgb(128, 128, 0);">struct</span><span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 0, 128);">divecomputer</span><span class="" style="color: rgb(192, 192, 192);"> </span>*dc,<span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">unsigned</span><span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">int</span><span class="" style="color: rgb(192, 192, 192);"> </span>time,<span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">int</span><span class="" style="color: rgb(192, 192, 192);"> </span>type,<span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">int</span><span class="" style="color: rgb(192, 192, 192);"> </span>flags,<span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">int</span><span class="" style="color: rgb(192, 192, 192);"> </span>value,<span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">const</span><span class="" style="color: rgb(192, 192, 192);"> </span><span class="" style="color: rgb(128, 128, 0);">char</span><span class="" style="color: rgb(192, 192, 192);"> </span>*name)</pre>
                    <div class=""><br class="">
                    </div>
                  </div>
                </blockquote>
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">Yes,
                  clear. For a test I created a dummy event @25min in
                  this way:</span><br style="font-family: Menlo-Regular;
                  font-size: 12px; font-style: normal;
                  font-variant-caps: normal; font-weight: normal;
                  letter-spacing: normal; orphans: auto; text-align:
                  start; text-indent: 0px; text-transform: none;
                  white-space: normal; widows: auto; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; background-color:
                  rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">add_event(&dive->dc,
                  60*25, SAMPLE_EVENT_AIRTIME, 0, 0, "Minimum gas
                  exceeded");</span><br style="font-family:
                  Menlo-Regular; font-size: 12px; font-style: normal;
                  font-variant-caps: normal; font-weight: normal;
                  letter-spacing: normal; orphans: auto; text-align:
                  start; text-indent: 0px; text-transform: none;
                  white-space: normal; widows: auto; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; background-color:
                  rgb(255, 255, 255);" class="">
                <br style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <br style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">When
                  looking for add_event I stumbled across<span
                    class="Apple-converted-space"> </span></span><a
                  moz-do-not-send="true" href="http://s.th/"
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">s.th</a><span
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">.:</span><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">I know
                  that one has to be careful where and when it is ok to
                  translate the name of an event. But my guess is that
                  for this event (line 195, diveprofileitem.cpp) we
                  would be allowed to translate it:</span><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">add_event(&displayed_dive.dc,
                  entry->sec, SAMPLE_EVENT_CEILING, -1, max / 1000,
                  "planned waypoint above ceiling");</span><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <br style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">What do
                  you think? Ok to change this to:</span><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">add_event(&displayed_dive.dc,
                  entry->sec, SAMPLE_EVENT_CEILING, -1, max / 1000,
                  translate("gettextFromC", "Planned waypoint above
                  ceiling"));</span><br style="font-family:
                  Menlo-Regular; font-size: 12px; font-style: normal;
                  font-variant-caps: normal; font-weight: normal;
                  letter-spacing: normal; orphans: auto; text-align:
                  start; text-indent: 0px; text-transform: none;
                  white-space: normal; widows: auto; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; background-color:
                  rgb(255, 255, 255);" class="">
                <br style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">And then
                  there is another one in planner.c where I'm not sure:</span><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <span style="font-family: Menlo-Regular; font-size:
                  12px; font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255); float:
                  none; display: inline !important;" class="">add_event(dc,
                  lasttime, SAMPLE_EVENT_PO2, 0, po2, "SP change");</span><br
                  style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
                <br style="font-family: Menlo-Regular; font-size: 12px;
                  font-style: normal; font-variant-caps: normal;
                  font-weight: normal; letter-spacing: normal; orphans:
                  auto; text-align: start; text-indent: 0px;
                  text-transform: none; white-space: normal; widows:
                  auto; word-spacing: 0px; -webkit-text-stroke-width:
                  0px; background-color: rgb(255, 255, 255);" class="">
              </div>
            </div>
          </blockquote>
        </div>
        <br class="">
        <div class="">
          <div style="color: rgb(0, 0, 0); font-family: Menlo;
            font-style: normal; font-variant: normal; font-weight:
            normal; letter-spacing: normal; line-height: normal;
            orphans: 2; text-align: -webkit-auto; text-indent: 0px;
            text-transform: none; white-space: normal; widows: 2;
            word-spacing: 0px; -webkit-text-stroke-width: 0px;
            word-wrap: break-word; -webkit-nbsp-mode: space;
            -webkit-line-break: after-white-space;" class="">
            <div style="color: rgb(0, 0, 0); font-family: Menlo;
              font-style: normal; font-variant: normal; font-weight:
              normal; letter-spacing: normal; line-height: normal;
              orphans: 2; text-align: -webkit-auto; text-indent: 0px;
              text-transform: none; white-space: normal; widows: 2;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;" class="">
              <div style="color: rgb(0, 0, 0); font-family: Menlo;
                font-style: normal; font-variant: normal; font-weight:
                normal; letter-spacing: normal; line-height: normal;
                orphans: 2; text-align: -webkit-auto; text-indent: 0px;
                text-transform: none; white-space: normal; widows: 2;
                word-spacing: 0px; -webkit-text-stroke-width: 0px;
                word-wrap: break-word; -webkit-nbsp-mode: space;
                -webkit-line-break: after-white-space;" class="">
                <div style="color: rgb(0, 0, 0); font-family: Menlo;
                  font-style: normal; font-variant: normal; font-weight:
                  normal; letter-spacing: normal; line-height: normal;
                  orphans: 2; text-align: -webkit-auto; text-indent:
                  0px; text-transform: none; white-space: normal;
                  widows: 2; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; word-wrap: break-word;
                  -webkit-nbsp-mode: space; -webkit-line-break:
                  after-white-space;" class="">Hmm. I guess, there is no
                  easy answer. There are uses of the name string like in
                  dive.c:</div>
                <div style="color: rgb(0, 0, 0); font-family: Menlo;
                  font-style: normal; font-variant: normal; font-weight:
                  normal; letter-spacing: normal; line-height: normal;
                  orphans: 2; text-align: -webkit-auto; text-indent:
                  0px; text-transform: none; white-space: normal;
                  widows: 2; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; word-wrap: break-word;
                  -webkit-nbsp-mode: space; -webkit-line-break:
                  after-white-space;" class=""><br class="">
                </div>
                <div style="color: rgb(0, 0, 0); font-family: Menlo;
                  font-style: normal; font-variant: normal; font-weight:
                  normal; letter-spacing: normal; line-height: normal;
                  orphans: 2; text-align: -webkit-auto; text-indent:
                  0px; text-transform: none; white-space: normal;
                  widows: 2; word-spacing: 0px;
                  -webkit-text-stroke-width: 0px; word-wrap: break-word;
                  -webkit-nbsp-mode: space; -webkit-line-break:
                  after-white-space;" class="">
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment--><span style=" color:#808000;" class="">struct</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800080;" class="">event</span><span style=" color:#c0c0c0;" class=""> </span>*get_next_event(<span style=" color:#808000;" class="">struct</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800080;" class="">event</span><span style=" color:#c0c0c0;" class=""> </span>*event,<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#808000;" class="">const</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#808000;" class="">char</span><span style=" color:#c0c0c0;" class=""> </span>*name)</pre>
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class="">
<!--EndFragment--></pre>
                  <div class="">where we search for events by name
                    (“gaschange” being a prominent example). This would
                    break if we started translating event names. We
                    would have at least then to search for translated
                    strings (and that I would consider quite ugly). </div>
                  <div class=""><br class="">
                  </div>
                  <div class="">[Here is a break where I started
                    actually looking into the source about event names]</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">From what I see, I would say,
                    translating event names is wrong. At least for the
                    internal storage. They should only be translated
                    when displayed to the user. For that I see for
                    example:</div>
                  <div class=""><br class="">
                  </div>
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment--><span style=" color:#808000;" class="">void</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800080;" class="">DiveEventItem</span>::setupToolTipString()</pre>
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class="">{</pre>
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">        </span><span style=" color:#008000;" class="">//</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">we</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">display</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">the</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">event</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">on</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">screen</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">-</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">so</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">translate</span></pre>
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">        </span><span style=" color:#800080;" class="">QString</span><span style=" color:#c0c0c0;" class=""> </span>name<span style=" color:#c0c0c0;" class=""> </span>=<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800080;" class="">gettextFromC</span>::instance()->tr(<span style=" color:#800000;" class="">internalEvent</span>-><span style=" color:#800000;" class="">name</span>);</pre>
                  <pre style="margin-top: 0px; margin-bottom: 0px;" class="">
<!--EndFragment--></pre>
                  <div class="">in diveeventiteM.cpp</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">Maybe my understanding of how the
                    translation works is wrong but I thought, we can
                    only translate strings that are already known at
                    compile time (but the actual translation happens at
                    runtime). Please somebody correct me if I am wrong!</div>
                  <div class=""><br class="">
                  </div>
                  <div class="">So, I guess, we actually need to teach
                    all possible event names to the translation splanned
                    waypointystem. I have no idea how too do that. Maybe
                    you could look into this? And then make sure, the
                    names only get translated when displaying them to
                    the user (i.e. event.name always holds untranslated
                    strings). <br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    I think I have it:<br>
    <br>
    QT_TRANSLATE_NOOP is the answer. E.g:<br>
    <br>
    add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2,
    QT_TRANSLATE_NOOP("gettextFromC", "SP change"));<br>
    <br>
    I will do a pull request for Dirk for this...<br>
    <br>
    Best regards<br>
    Stefan<br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
      <title></title>
      <meta name="GENERATOR" content="OpenOffice.org 3.3 (Win32)">
      <meta name="CREATED" content="0;0">
      <meta name="CHANGEDBY" content="Stefan Fuchs">
      <meta name="CHANGED" content="20120503;23115492">
      <style type="text/css">
        <!--
                P { color: #000000 }
        -->
        </style>
      <p>Stefan Fuchs<br>
        E-Mail: <a href="mailto:sfuchs@gmx.de">sfuchs@gmx.de</a></p>
    </div>
  </body>
</html>