<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="https://git.reviewboard.kde.org/r/118584/">https://git.reviewboard.kde.org/r/118584/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On June 6th, 2014, 11:53 a.m. BST, <b>Sebastian Kügler</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'd like to hear John's take on this. IIRC, bcp47Name() is the correct one to use here. (Which leaves questions indeed.)</pre>
</blockquote>
<p>On June 6th, 2014, 1:55 p.m. BST, <b>Luca Beltrame</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Indeed. But for some reason, at least on my system, bcp47Name() returns "it" only, and that breaks everything. Hence the reason for this patch.
Also I wanted indeed to wait till the "pros" gave their answers. ;)</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Please don't make me read the BCP47 standard again: it's long and complicated and ambiguous and I read it three times and still didn't understand it :-) What I do remember with BCP47 is that the standard states it should always return the minimal code required to identify a locale. For example, if your locale fully expressed is "it_IT@Latn" then bcp47name() returns just "it" as Italy and Latin are the default country and script values for Italian and so are unneeded. This compares to name() which will always return the form language_COUNTRY regardless of the locale (unless country is explicitly set to AnyCountry) but will always leave off the script for backwards compatibility reasons. I need to go back to the POSIX standard to check, but I think it expects to have the country explicitly included, but the script only if not the default (or not Latn?). If so Qt needs a posixName() which we'd need to simulate for now. I also need to look into the .UTF-8 stuff as well.</pre>
<br />
<p>- John</p>
<br />
<p>On June 6th, 2014, 7:45 a.m. BST, Luca Beltrame wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://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 Plasma, John Layt and Sebastian Kügler.</div>
<div>By Luca Beltrame.</div>
<p style="color: grey;"><i>Updated June 6, 2014, 7:45 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-desktop
</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;">Currently the Formats KCM writes its configuration file using the selected locale's bcp47Name(). This, at least on my distro, breaks locale loading as locales are in the form "foo_FOO" (e.g., "it_IT" for my own locale) and instead the Formats KCM exports LANG as "foo" (e.g. "it").
This causes a bunch of runtime warnings and locales don't get actually loaded. This patch's approach is naive and likely needs more pairs of eyes on it, as I can't test with other distros.
Also we might need "UTF-8" suffix for distros that use UTF-8 locales: or so I think, but I'm not knowledgeable enough to tell if this is needed or not.</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;">Compiled, ran the Formats KCM, selected my country, inspected the generated files.</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>kcms/formats/kcmformats.cpp <span style="color: grey">(4169244)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118584/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>