<table><tr><td style="">sitter updated this revision to Diff 47623.<br />sitter added a subscriber: hein.<br />sitter 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/D10446">View Revision</a></tr></table><br /><div><div><p>iterating the diff a bit as mentioned in a comment.</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">new unit test which covers all likely scenarios (I think). this uses fixtures and doesn't require anything to be installed etc.</li>
<li class="remarkup-list-item">the specific func now calls the generic to resolve into current-language. this requires some string mangling as qlocale apparently has no way to get the ISO639-1 string directly</li>
<li class="remarkup-list-item">some refinement on the english-check resolution: now returns the kconfig resolved name iff it is different from english and it is not english (previously this was a bit bugged for english itself)</li>
<li class="remarkup-list-item">some refinement on the qlocale fallback: now returns immediately when a final result is found (simplifies code a bit)</li>
<li class="remarkup-list-item">a failed kconfig resolution (for whatever reason) now always continues onwards into the qlocale fallback. this effectively separates the kconfig portion entirely from the qlocale portion for ease of reading</li>
</ul>

<p>as mentioned in an earlier comment I am not too sure about giving out languageToString names and would rather have it always give out nativeLanguageNames. I am somewhat indifferent on the issue though, it's just a gut feeling is all.</p>

<p>I should also note that I had a quick look at systemsettings and it also does exhaustive poking of QLocale to come up with reasonable prettynames for locales (and then fails in part). Perhaps <a href="https://phabricator.kde.org/p/hein/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@hein</a> could take a look at this diff and see if it could be useful for the language KCM and/or give some thoughts on what may be needed to make that happen. For the record though: since KLanguageName exclusively deals with languages and the KCM AFAIK deals with locales there is no 100% overlap; perhaps there should be though.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R265 KConfigWidgets</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D10446?vs=26943&id=47623">https://phabricator.kde.org/D10446?vs=26943&id=47623</a></div></div><br /><div><strong>BRANCH</strong><div><div>arcpatch-D10446</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10446">https://phabricator.kde.org/D10446</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/CMakeLists.txt<br />
autotests/kf5_entry_data/locale/ca/kf5_entry.desktop<br />
autotests/kf5_entry_data/locale/de/kf5_entry.desktop<br />
autotests/kf5_entry_data/locale/en_US/kf5_entry.desktop<br />
autotests/kf5_entry_data/locale/fr/kf5_entry.desktop<br />
autotests/kf5_entry_data/locale/pt/kf5_entry.desktop<br />
autotests/klanguagenametest.cpp<br />
src/CMakeLists.txt<br />
src/klanguagename.cpp<br />
src/klanguagename.h</div></div></div><br /><div><strong>To: </strong>aacid<br /><strong>Cc: </strong>hein, kde-frameworks-devel, sitter, markg, apol, michaelh, ngraham, bruns<br /></div>