<div dir="ltr"><div>Привет!<br><br></div>Нам бы тоже в kdeplasma-addons/plasma_applet_fuzzy_clock.po не помешала такая магия с использованием Transcript. Сейчас "half past %1" переведено как "%1 тридцать", но хочется, чтобы вместо "пять тридцать" часы всё-таки показывали "половина шестого".<br>
<div><div><br></div><div>Прошу прощения за письмо в HTML.<br></div><div><br>-- <br>Alexander Potashev<br><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Lasse Liehu</b> <span dir="ltr"><<a href="mailto:lasse.liehu@gmail.com">lasse.liehu@gmail.com</a>></span><br>
Date: 2014-08-14 22:33 GMT+04:00<br>Subject: Re: Review Request 119738: Port Fuzzy Clock to Plasma 5<br>To: Lasse Liehu <<a href="mailto:lasse.liehu@gmail.com">lasse.liehu@gmail.com</a>>, Plasma <<a href="mailto:plasma-devel@kde.org">plasma-devel@kde.org</a>>, Kai Uwe Broulik <<a href="mailto:kde@privat.broulik.de">kde@privat.broulik.de</a>>, David Edmundson <<a href="mailto:david@davidedmundson.co.uk">david@davidedmundson.co.uk</a>>, Marco Martin <<a href="mailto:notmart@gmail.com">notmart@gmail.com</a>><br>
<br><br>
<div>
<div style="font-family:Verdana,Arial,Helvetica,Sans-Serif"><div class="">
<table style="border:1px solid rgb(201,195,153);border-radius:6px" bgcolor="#f9f3c9" cellpadding="12" width="100%">
<tbody><tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/119738/" target="_blank">https://git.reviewboard.kde.org/r/119738/</a>
</td>
</tr>
</tbody></table>
<br>
</div><blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px"><div class="">
<p style="margin-top:0px">On elokuu 14th, 2014, 4:58 ip UTC, <b>David Edmundson</b> wrote:</p>
<blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px">
<table bgcolor="white" border="0" width="100%">
<thead>
<tr>
<th colspan="4" style="border-bottom:1px solid rgb(192,192,192);font-size:9pt;padding:4px 8px;text-align:left" bgcolor="#F0F0F0">
<a href="https://git.reviewboard.kde.org/r/119738/diff/1/?file=304020#file304020line118" style="color:black;font-weight:bold;text-decoration:underline" target="_blank">applets/fuzzy-clock/package/contents/ui/FuzzyClock.qml</a>
<span style="font-weight:normal">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th style="border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0px"></pre></td>
<th style="border-left:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192)" align="right" bgcolor="#b1ebb0"><font>118</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size:8pt;line-height:140%;margin:0px"> <span>var</span> <span>timeString</span> <span>=</span> <span>i18n</span><span>(</span><span>normalFuzzy</span><span>[</span><span>Math</span><span>.</span><span>floor</span><span>(</span><span>sector</span><span>)].</span><span>replace</span><span>(</span><span>/\$1/g</span><span>,</span><span>'%1'</span><span>),</span> <span>hourNames</span><span>[</span><span>Math</span><span>.</span><span>floor</span><span>(</span><span>realHour</span><span>)])</span></pre>
</td>
</tr>
</tbody>
</table>
<pre style="white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">we don't need the i18n here, we'd be trying to translate an already translated string.</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">hourNames[Math.floor()] seems wrong, would that not give us</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">5 to 9</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">when it's 9:55?</p></pre>
</blockquote>
</div><div class=""><p>On elokuu 14th, 2014, 5:04 ip UTC, <b>Kai Uwe Broulik</b> wrote:</p>
<blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px">
<pre style="white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">Ah, that is why :) </p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">Hmm, the original implementation just casts to int, I think. Would a Math.round fix that?</p></pre>
</blockquote>
</div><div class=""><p>On elokuu 14th, 2014, 5:07 ip UTC, <b>Kai Uwe Broulik</b> wrote:</p>
<blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px">
<pre style="white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">But honestly I don't really get that fuzzy logic either. Will test.</p></pre>
</blockquote>
</div><div class=""><p>On elokuu 14th, 2014, 5:15 ip UTC, <b>Marco Martin</b> wrote:</p>
<blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px">
<pre style="white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">Math.round seems more correct, yes</p></pre>
</blockquote>
</div><div class=""><p>On elokuu 14th, 2014, 6:14 ip UTC, <b>David Edmundson</b> wrote:</p>
<blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px">
<pre style="white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">I don't think either works. Assume the time is 10:30</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">in English that's half past ten.<br style="padding:0px;margin:0px;line-height:inherit;white-space:normal">
In German that's half to eleven.</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">Not sure how to solve that.</p></pre>
</blockquote>
</div><div class=""><p>On elokuu 14th, 2014, 6:23 ip UTC, <b>Kai Uwe Broulik</b> wrote:</p>
<blockquote style="margin-left:1em;border-left:2px solid rgb(208,208,208);padding-left:10px">
<pre style="white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit"><a href="http://websvn.kde.org/" target="_blank">http://websvn.kde.org/</a><i style="padding:0px;margin:0px;line-height:inherit;white-space:normal">checkout</i>/branches/stable/l10n-kde4/de/messages/kdeplasma-addons/plasma_applet_fuzzy_clock.po</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">That is the German translation file. And it does some "30 Minuten nach %1|/|halb $[stunde+1 %1]" magic. How does that work? eins|/|$[Eigenschaft stunde+1 zwei] $[Eigenschaft vollestunde ein] ?! So I guess here lies the trick.</p>
</pre>
</blockquote>
</div></blockquote>
<pre style="margin-left:1em;white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">This is scripting translations using Transcript, <a href="https://techbase.kde.org/Localization/Concepts/Transcript" target="_blank">https://techbase.kde.org/Localization/Concepts/Transcript</a></p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">A property stunde+1 is added to each hour message. For example "one" is translated as "eins|/|$[Eigenschaft stunde+1 zwei] $[Eigenschaft vollestunde ein]". Then translation of "half past %1" uses that property by calling "$[stunde+1 %1]", which returns "zwei".</p>
</pre>
<br>
<p>- Lasse</p><div class="">
<br>
<p>On elokuu 12th, 2014, 6:08 ip UTC, Kai Uwe Broulik wrote:</p>
</div><table style="border:1px solid rgb(136,138,133);border-radius:6px" bgcolor="#fefadf" cellpadding="12" cellspacing="0" width="100%">
<tbody><tr>
<td><div class="">
<div>Review request for Plasma.</div>
<div>By Kai Uwe Broulik.</div>
</div><p style="color:grey"><i>Updated elo 12, 2014, 6:08 ip</i></p><div><div class="h5">
<div style="margin-top:1.5em">
<b style="color:rgb(87,80,18);font-size:10pt">Repository: </b>
kdeplasma-addons
</div>
<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Description </h1>
<table style="border:1px solid rgb(184,181,160)" bgcolor="#ffffff" cellpadding="10" cellspacing="0" width="100%">
<tbody><tr>
<td>
<pre style="margin:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">This ports the infamous Fuzzy Clock to Plasma 5.</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">The code is derived from digital clock with the fuzzy logic derived from the original implementation.</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">I had to substitute %1 by $1 in the i18n strings (and replace them back), otherwise I got "I18N_EXCESSIVE_ARGUMENTS" thingies appended to my fuzzy string.</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">Missing is the ability to show the time zone (really needed here?), and the "Percent of taskbar size" slider because that layouting logic copied from digital clock is beyond me :)<br style="padding:0px;margin:0px;line-height:inherit;white-space:normal">
Also missing is the "Configure time format" (why's there no "Configure Date and Time" in digital clock?) because fuzzy clock doesn't really adhere to the locale anyway and I didn't want to yet again duplicate that ProcessRunner plugin which seems to have been copied all over the place already.</p>
</pre>
</td>
</tr>
</tbody></table>
<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Testing </h1>
<table style="border:1px solid rgb(184,181,160)" bgcolor="#ffffff" cellpadding="10" cellspacing="0" width="100%">
<tbody><tr>
<td>
<pre style="margin:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word"><p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">I've been running it since yesterday evening and didn't notice unusual behavior, except that due to the update interval of 30s it doesn't update right away when session is resumed from Suspend (but I guess this is a Plasma issue?).</p>
<p style="padding:0px;margin:0px;line-height:inherit;white-space:inherit">Also it tends to cut off in a vertical panel due to its (sane) minimum font size (smallest theme font) being larger than in the original implementation where it used to get super tiny then.</p>
</pre>
</td>
</tr>
</tbody></table>
<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">Diffs </h1>
<ul style="margin-left:3em;padding-left:0px">
<li>applets/fuzzy-clock/fuzzyClockConfig.ui <span style="color:grey">(15cc658)</span></li>
<li>applets/fuzzy-clock/package/contents/config/config.qml <span style="color:grey">(PRE-CREATION)</span></li>
<li>applets/fuzzy-clock/package/contents/config/main.xml <span style="color:grey">(PRE-CREATION)</span></li>
<li>applets/fuzzy-clock/package/contents/ui/FuzzyClock.qml <span style="color:grey">(PRE-CREATION)</span></li>
<li>applets/fuzzy-clock/package/contents/ui/configAppearance.qml <span style="color:grey">(PRE-CREATION)</span></li>
<li>applets/fuzzy-clock/package/contents/ui/main.qml <span style="color:grey">(PRE-CREATION)</span></li>
<li>applets/fuzzy-clock/package/metadata.desktop <span style="color:grey">(PRE-CREATION)</span></li>
<li>applets/fuzzy-clock/plasma-clock-fuzzy.desktop <span style="color:grey">(5f6d30b)</span></li>
<li>applets/CMakeLists.txt <span style="color:grey">(661ecb4)</span></li>
<li>applets/fuzzy-clock/CMakeLists.txt <span style="color:grey">(1068150)</span></li>
<li>applets/fuzzy-clock/Messages.sh <span style="color:grey">(c8c9f06)</span></li>
<li>applets/fuzzy-clock/fuzzyClock.h <span style="color:grey">(9bf5c4e)</span></li>
<li>applets/fuzzy-clock/fuzzyClock.cpp <span style="color:grey">(2cd189d)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/119738/diff/" style="margin-left:3em" target="_blank">View Diff</a></p>
<h1 style="color:rgb(87,80,18);font-size:10pt;margin-top:1.5em">File Attachments </h1>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/08/12/35e0fea1-8a28-4ddb-9a81-9112bb85eab5__fuzzyinapanel.png" target="_blank">In horizontal panel</a></li>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/08/12/a246f3b3-bb12-4756-8069-594d25bd39f6__fuzzyonthedesktop.png" target="_blank">On the Desktop</a></li>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/08/12/a144ea07-e18a-4a90-965a-3db51d91fb5d__fuzzyconfig.png" target="_blank">Configuration UI</a></li>
</div></div></td>
</tr>
</tbody></table>
</div>
</div>
<br>_______________________________________________<br>
Plasma-devel mailing list<br>
<a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br>
<br></div></div></div></div>