<table><tr><td style="">mpyne created this revision.<br />mpyne added reviewers: Frameworks, kde-i18n-doc, aspotashev.<br />mpyne set the repository for this revision to R244 KCoreAddons.<br />Restricted Application added a project: Frameworks.
</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/D4023" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p><a href="https://api.kde.org/frameworks/kcoreaddons/html/classKFormat.html#a6adf12070942eb8e6c9efd862edb8b65" class="remarkup-link" target="_blank" rel="noreferrer">KFormat::formatRelativeDate</a> allows one to obtain a human-readable date like "Last Wednesday" or "Next Thursday" for dates within a week of the current date.</p>
<p>The returned string cannot be properly translated in all languages since it's generated using a placeholder of the form "Next %1" -- the word Next (or Last) may itself need to be modified to be correct which can't be done with the current translation system.</p>
<p>The fix is just to return "Next $dayName" directly, based on the day name as appropriate, and allow the translators to translate the entire phrase.</p>
<p>The auto tests are adjusted as well. They were actually incorrect before this change, since the API documentation for <tt style="background: #ebebeb; font-size: 13px;">formatRelativeDate</tt> makes clear that the date format is only applied if the date is *not* within a week of the current date.</p>
<p>See also <a href="https://bugs.kde.org/show_bug.cgi?id=335106" class="remarkup-link" target="_blank" rel="noreferrer">Bug 335106</a>.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Change builds and installs properly, and all kcoreaddons tests continue to pass (with the <tt style="background: #ebebeb; font-size: 13px;">kformattest</tt> autotest revised per this change).</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R244 KCoreAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4023" rel="noreferrer">https://phabricator.kde.org/D4023</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/kformattest.cpp<br />
src/lib/util/kformatprivate.cpp</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>mpyne, Frameworks, kde-i18n-doc, aspotashev<br /></div>