[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    D13219: Locale-aware formatting of numbers on status bar
From:       Karl Ove Hufthammer <noreply () phabricator ! kde ! org>
Date:       2019-09-01 17:19:39
Message-ID: bf8ff0f7b8e32e79b812c6738108b7aa () localhost ! localdomain
[Download RAW message or body]

[Attachment #2 (text/plain)]

huftis added a comment.


  In D13219#500863 <https://phabricator.kde.org/D13219#500863>, @safaalfulaij wrote:
  
  > In D13219#499990 <https://phabricator.kde.org/D13219#499990>, @huftis wrote:>
  >
  > > I've just tested this, but changing %1 to %L1 <https://phabricator.kde.org/L1> \
doesn't seem work; the `%L1` is displayed verbatim.  >
  >
  > Did you test it with Qt's system, or KI18n? I meant to use it with `tr()` (KF5 \
Tier 1 libraries that uses Qt localization system, like `KI18n`).  
  
  I only tested it with `i18n()`. Changing
  
    statusBarItems.insert(ID_STATUS_TOTAL, i18nc("@info:status message entries", \
"Total: %1", total));  
  in `src/project/projecttab.cpp` into
  
    statusBarItems.insert(ID_STATUS_TOTAL, tr("Total: %L1", "@info:status message \
entries").arg(total));  
  **does** work  – sort of. That is, the number is displayed using my locale \
setting (123456 is displayed as `123 456`). However, the **translation** of the \
string isn't used (so the string is displayed as `Total: 123 456` instead of \
`TranslationOfTotalString: 123 456`). (I did updated `%1` to `%L1` in the .po/.mo \
file.)

REPOSITORY
  R456 Lokalize

REVISION DETAIL
  https://phabricator.kde.org/D13219

To: huftis, aacid, ngraham, ltoscano, shaforostoff, #localization
Cc: adrianchavesfernandez, aspotashev, yurchor, kossebau, kde-i18n-doc, safaalfulaij, \
ilic, #localization, fbampaloukas, sdepiets, skadinna, huftis, pshinjo


[Attachment #3 (text/html)]

<table><tr><td style="">huftis added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: \
right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: \
#F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: \
inline-block; border: 1px solid rgba(71,87,120,.2);" \
href="https://phabricator.kde.org/D13219">View Revision</a></tr></table><br \
/><div><div><blockquote style="border-left: 3px solid #8C98B8;  color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a \
href="https://phabricator.kde.org/D13219#500863" style="background-color: #e7e7e7;  \
border-color: #e7e7e7;  border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D13219#500863</a>, <a \
href="https://phabricator.kde.org/p/safaalfulaij/" style="  border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@safaalfulaij</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><blockquote style="border-left: 3px solid \
#8C98B8;  color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a \
href="https://phabricator.kde.org/D13219#499990" style="background-color: #e7e7e7;  \
border-color: #e7e7e7;  border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D13219#499990</a>, <a \
href="https://phabricator.kde.org/p/huftis/" style="  border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@huftis</a> wrote:&gt;</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>I've just tested this, but changing %1 to \
%<a href="https://phabricator.kde.org/L1" style="background-color: #e7e7e7;  \
border-color: #e7e7e7;  border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">L1</a> doesn't seem work; the <tt \
style="background: #ebebeb; font-size: 13px;">%L1</tt> is displayed \
verbatim.</p></div> </blockquote>

<p>Did you test it with Qt&#039;s system, or KI18n? I meant to use it with <tt \
style="background: #ebebeb; font-size: 13px;">tr()</tt> (KF5 Tier 1 libraries that \
uses Qt localization system, like <tt style="background: #ebebeb; font-size: \
13px;">KI18n</tt>).</p></div> </blockquote>

<p>I only tested it with <tt style="background: #ebebeb; font-size: \
13px;">i18n()</tt>. Changing</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; padding: \
12px; margin: 0; background: rgba(71, 87, 120, \
0.08);">statusBarItems.insert(ID_STATUS_TOTAL, i18nc(&quot;@info:status message \
entries&quot;, &quot;Total: %1&quot;, total));</pre></div>

<p>in <tt style="background: #ebebeb; font-size: \
13px;">src/project/projecttab.cpp</tt> into</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" \
data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px \
&quot;Menlo&quot;, &quot;Consolas&quot;, &quot;Monaco&quot;, monospace; padding: \
12px; margin: 0; background: rgba(71, 87, 120, \
0.08);">statusBarItems.insert(ID_STATUS_TOTAL, tr(&quot;Total: %L1&quot;, \
&quot;@info:status message entries&quot;).arg(total));</pre></div>

<p><strong>does</strong> work  – sort of. That is, the number is displayed using my \
locale setting (123456 is displayed as <tt style="background: #ebebeb; font-size: \
13px;">123 456</tt>). However, the <strong>translation</strong> of the string isn't \
used (so the string is displayed as <tt style="background: #ebebeb; font-size: \
13px;">Total: 123 456</tt> instead of <tt style="background: #ebebeb; font-size: \
13px;">TranslationOfTotalString: 123 456</tt>). (I did updated <tt style="background: \
#ebebeb; font-size: 13px;">%1</tt> to <tt style="background: #ebebeb; font-size: \
13px;">%L1</tt> in the .po/.mo file.)</p></div></div><br \
/><div><strong>REPOSITORY</strong><div><div>R456 Lokalize</div></div></div><br \
/><div><strong>REVISION DETAIL</strong><div><a \
href="https://phabricator.kde.org/D13219">https://phabricator.kde.org/D13219</a></div></div><br \
/><div><strong>To: </strong>huftis, aacid, ngraham, ltoscano, shaforostoff, \
Localization<br /><strong>Cc: </strong>adrianchavesfernandez, aspotashev, yurchor, \
kossebau, kde-i18n-doc, safaalfulaij, ilic, Localization, fbampaloukas, sdepiets, \
skadinna, huftis, pshinjo<br /></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic