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




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDE Frameworks, Albert Astals Cid, Aleix Pol Gonzalez, and Chusslove Illich.</div>
<div>By Vishesh Handa.</div>


<p style="color: grey;"><i>Updated Aug. 27, 2013, 1:08 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Updated comments to better reflect the problem.

Originally, QLocale::uiLanguages() used to return $LANGUAGE, it was then changed to return it the bcp47 format [1]. This format is obviously not consistent with the QLocale::name() format, but this seems to intentional. There is a QLocale::bcp47Name() for people wishing to use uiLangauges. Therefore the code posted above should be -

QLocale locale;
locale.uiLanguages().contains(locale.bcp47Name()); // returns true

--

Since we operate on the setlocale format, the code is now just a rough translator between bcp47 and the setlocale format. It doesn't cover the bcp47 grammar[2] completely, but it does cover the grammar QLocale generates.

[1] https://codereview.qt-project.org/#change,25016
[2] http://tools.ietf.org/html/bcp47#section-2.1</pre>
  </td>
 </tr>
</table>




<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;">    Make KLocalizedString::isApplicationTranslatedInto & QLocale::uiLanguages compatible
    
    QLocale::uiLanguages returns "lang-script-country" whereas KCatalog
    expects the format to be "lang_countr@script". We need to convert the
    format before checking if the corresponding catalog exists.

</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;">Limited testing done. My QLocale::uiLanguages() returns "en-US" which is correctly converted to "en_US". I haven't tested it with anything else. Any tips on how I should go about testing this?</pre>
  </td>
 </tr>
</table>




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

 <li>staging/ki18n/src/klocalizedstring.cpp <span style="color: grey">(eab9216)</span></li>

</ul>

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







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




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