https://bugs.kde.org/show_bug.cgi?id=335106

Michael Pyne <mp...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://commits.kde.org/kco
                   |                            |readdons/aeff11101f8513209f
                   |                            |52aabfa72ee8b9349b915f
         Resolution|---                         |FIXED
   Version Fixed In|                            |5.31

--- Comment #13 from Michael Pyne <mp...@kde.org> ---
Git commit aeff11101f8513209f52aabfa72ee8b9349b915f by Michael Pyne.
Committed on 17/01/2017 at 01:45.
Pushed by mpyne into branch 'master'.

kformat: Make it possible to properly translate relative dates.

KFormat::formatRelativeDate allows one to obtain a human-readable date like
"Last Wednesday" or "Next Thursday" for dates within a week of the current
date.

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.

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.

The auto tests are adjusted as well. They were actually incorrect before this
change, since the API documentation for formatRelativeDate makes clear that the
date format is only applied if the date is *not* within a week of the current
date.
FIXED-IN:5.31

Differential Revision: https://phabricator.kde.org/D4023

M  +10   -4    autotests/kformattest.cpp
M  +38   -10   src/lib/util/kformatprivate.cpp

https://commits.kde.org/kcoreaddons/aeff11101f8513209f52aabfa72ee8b9349b915f

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to