<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 03/13/2014 10:44 PM, Doug Hellmann
      wrote:<br>
    </div>
    <blockquote
cite="mid:CADb+p3QERkfLvvbX=8JVMpHwuzSebEChX+L5GjaNcZQX_HhvVw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-size:small"><br>
        </div>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">On Thu, Feb 27, 2014 at 3:45 AM,
            yongli he <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:yongli.he@intel.com" target="_blank">yongli.he@intel.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"> refer to :<br>
                <a moz-do-not-send="true"
                  href="https://wiki.openstack.org/wiki/Translations"
                  target="_blank">https://wiki.openstack.org/wiki/Translations</a><br>
                <br>
                now some exception use _ and some not.  the wiki suggest
                do not to do that. but i'm not sure.<br>
                <br>
                what's the correct way?<br>
                <br>
                <br>
                F.Y.I <br>
                <br>
                <h4><span>What To Translate</span></h4>
                <p
                  style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:20px;color:rgb(51,51,51);text-transform:none;font-size:14px;white-space:normal;margin:0px
                  0px 10px;font-family:'Arial Unicode
                  MS',Arial,sans-serif;word-spacing:0px">
                  At present the convention is to translate<span> </span><i>all</i><span> </span>user-facing
                  strings. This means API messages, CLI responses,
                  documentation, help text, etc.</p>
                <p
                  style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:20px;color:rgb(51,51,51);text-transform:none;font-size:14px;white-space:normal;margin:0px
                  0px 10px;font-family:'Arial Unicode
                  MS',Arial,sans-serif;word-spacing:0px">
                  There has been a lack of consensus about the
                  translation of log messages; the current ruling is
                  that while it is not against policy to mark log
                  messages for translation if your project feels
                  strongly about it, translating log messages is not
                  actively encouraged.</p>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>
              <div class="gmail_default" style="font-size:small">I've
                updated the wiki to replace that paragraph with a
                pointer to <a moz-do-not-send="true"
                  href="https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation">https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation</a>
                which explains the log translation rules. We will be
                adding the job needed to have different log translations
                during Juno.</div>
              <br>
            </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <p
                  style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:20px;color:rgb(51,51,51);text-transform:none;font-size:14px;white-space:normal;margin:0px
                  0px 10px;font-family:'Arial Unicode
                  MS',Arial,sans-serif;word-spacing:0px">
                  Exception text should<span> </span><i>not</i><span> </span>be
                  marked for translation, becuase if an exception occurs
                  there is no guarantee that the translation machinery
                  will be functional.</p>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>
              <div class="gmail_default" style="font-size:small">This
                makes no sense to me. Exceptions should be translated.
                By far the largest number of errors will be presented to
                users through the API or through Horizon (which gets
                them from the API). We will ensure that the translation
                code does its best to fall back to the original string
                if the translation fails.</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    There is another option: exception can contain non localized string
    and a thin wrapper will translate them on API layer right before
    output. <br>
    Something like:<br>
    print _(str(exception)).<br>
    <br>
    It seems a cleaner solution to me since we don't need to add
    translations all over the code and we call a gettext just once when
    it's actually needed.<br>
    <blockquote
cite="mid:CADb+p3QERkfLvvbX=8JVMpHwuzSebEChX+L5GjaNcZQX_HhvVw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>
              <div class="gmail_default" style="font-size:small"><br>
              </div>
              <div class="gmail_default" style="font-size:small">Doug</div>
              <br>
            </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"> <br>
                <br>
                Regards<span class=""><font color="#888888"><br>
                    Yongli He<br>
                    <br>
                  </font></span></div>
              <br>
              _______________________________________________<br>
              OpenStack-dev mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
              <a moz-do-not-send="true"
                href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev"
                target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
              <br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
OpenStack-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>