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

List:       kde-i18n-doc
Subject:    Re: Review Request 125682: Pre-fill translator information for KAboutApplicationDialog
From:       Lorenzo Porta <vindex17 () outlook ! it>
Date:       2016-01-20 12:02:57
Message-ID: 20160120120257.18835.64045 () mimi ! kde ! org
[Download RAW message or body]

--===============2834315876159381728==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125682/#review91379
-----------------------------------------------------------




src/kmainwindow.cpp (lines 213 - 214)
<https://git.reviewboard.kde.org/r/125682/#comment62465>

    These don't work because a null domain return nothing. You must replace Q_NULLPTR \
with KLocalizedString::applicationDomain()


- Lorenzo Porta


On Ott. 22, 2015, 2:31 a.m., Michael Pyne wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125682/
> -----------------------------------------------------------
> 
> (Updated Ott. 22, 2015, 2:31 a.m.)
> 
> 
> Review request for KDE Frameworks, Localization and Translation (l10n) and Albert \
> Astals Cid. 
> 
> Bugs: 345320
> https://bugs.kde.org/show_bug.cgi?id=345320
> 
> 
> Repository: kxmlgui
> 
> 
> Description
> -------
> 
> KAboutData has a placeholder for information regarding who translated the running \
> KDE-based application (KAboutData::translators()). However it relies on the \
> application developer to call KAboutData::setTranslator() since KCoreAddons (a Tier \
> 1 framework) cannot use KI18n directly. Instead the Qt translation infrastructure \
> is used where translations are unavoidable, but that is not compatible with KF5's \
> i18n. This (IIUC) gives different behavior than KDE4, where KAboutData could (and \
> did!) directly pull the translated list of translators, so application authors \
> didn't have to do anything special for their about dialog to have the list of \
> translators. 
> For the majority of our applications we can make the ::setTranslator() call on the \
> application developer's behalf, as recommended by Albert on kdeframeworks-devel, \
> and by doing so from KMainWindow (a relatively central location for KF5-using \
> applications) we can use KI18n and get the accurately-translated message. Feeding \
> the already-translated information into KAboutData should work to form the list of \
> translators for later use by KAboutApplicationDialog, or other accessors of that \
> information. 
> This patch implements all that. I avoided using a global startup method as \
> suggested by Albert (since the Qt docs suggest that this startup would happen \
> *before* the GUI starts up, and I want to make sure KI18n is available); \
> KMainWindow seems the next best option, and even non-KXmlGuiWindow users might use \
> this. There are probably other good alternatives too (maybe even the platform \
> plugin?). 
> 
> Diffs
> -----
> 
> src/kmainwindow.h 11dcfca 
> src/kmainwindow.cpp 7c86841 
> 
> Diff: https://git.reviewboard.kde.org/r/125682/diff/
> 
> 
> Testing
> -------
> 
> Compiled, apps all still work.
> 
> I find it hard to test whether the translators actually show up or not though, as I \
> do not use translated KF5 apps. 
> 
> Thanks,
> 
> Michael Pyne
> 
> 


--===============2834315876159381728==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit




<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">  \
<tr>  <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/125682/">https://git.reviewboard.kde.org/r/125682/</a>
  </td>
    </tr>
   </table>
   <br />











<div>



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="https://git.reviewboard.kde.org/r/125682/diff/3/?file=411972#file411972line213" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/kmainwindow.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">213</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">              \
<span class="n">i18ndc</span><span class="p">(</span><span \
class="n">Q_NULLPTR</span><span class="p">,</span> <span class="s">&quot;NAME OF \
TRANSLATORS&quot;</span><span class="p">,</span> <span class="s">&quot;Your \
names&quot;</span><span class="p">),</span></pre></td>  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">214</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">              \
<span class="n">i18ndc</span><span class="p">(</span><span \
class="n">Q_NULLPTR</span><span class="p">,</span> <span class="s">&quot;EMAIL OF \
TRANSLATORS&quot;</span><span class="p">,</span> <span class="s">&quot;Your \
emails&quot;</span><span class="p">));</span></pre></td>  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">These don&#39;t work \
because a null domain return nothing. You must replace Q_NULLPTR with \
KLocalizedString::applicationDomain()</pre>  </div>
</div>
<br />



<p>- Lorenzo Porta</p>


<br />
<p>On ottobre 22nd, 2015, 2:31 a.m. CEST, Michael Pyne wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;">  <tr>
  <td>

<div>Review request for KDE Frameworks, Localization and Translation (l10n) and \
Albert Astals Cid.</div> <div>By Michael Pyne.</div>


<p style="color: grey;"><i>Updated Ott. 22, 2015, 2:31 a.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://bugs.kde.org/show_bug.cgi?id=345320">345320</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kxmlgui
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">KAboutData has a placeholder for information regarding \
who translated the running KDE-based application (KAboutData::translators()). However \
it relies on the application developer to call KAboutData::setTranslator() since \
KCoreAddons (a Tier 1 framework) cannot use KI18n directly. Instead the Qt \
translation infrastructure is used where translations are unavoidable, but that is \
not compatible with KF5's i18n. This (IIUC) gives different behavior than KDE4, where \
KAboutData could (and did!) directly pull the translated list of translators, so \
application authors didn't have to do anything special for their about dialog to have \
the list of translators.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">For the majority of our applications we \
can make the ::setTranslator() call on the application developer's behalf, as \
recommended by Albert on kdeframeworks-devel, and by doing so from KMainWindow (a \
relatively central location for KF5-using applications) we can use KI18n and get the \
accurately-translated message. Feeding the already-translated information into \
KAboutData should work to form the list of translators for later use by \
KAboutApplicationDialog, or other accessors of that information.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">This patch implements all that. I avoided using a global startup method as \
suggested by Albert (since the Qt docs suggest that this startup would happen <em \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
normal;">before</em> the GUI starts up, and I want to make sure KI18n is available); \
KMainWindow seems the next best option, and even non-KXmlGuiWindow users might use \
this. There are probably other good alternatives too (maybe even the platform \
plugin?).</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Compiled, apps all still work.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
find it hard to test whether the translators actually show up or not though, as I do \
not use translated KF5 apps.</p></pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/kmainwindow.h <span style="color: grey">(11dcfca)</span></li>

 <li>src/kmainwindow.cpp <span style="color: grey">(7c86841)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/125682/diff/" style="margin-left: \
3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>


--===============2834315876159381728==--


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

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