Revision 1188668

Go back to digest for 24th October 2010

Features in KDE Base

John Layt committed changes in /trunk/KDE/kdelibs/kdecore:

KLocale: Provide common localization of AM/PM text.

This change moves the localization of AM/PM into KLocale allowing for a single consistent translation that can be overridden at system, country or user level.

Currently AM/PM text is translated in several different places which could lead to inconsistencies.
The translation is also only done at language level, meaning country level localization cannot be performed and users cannot modify them to their personal preference.
Further, it will become a problem on the Mac and Windows platforms when we switch to use the platform localization settings as they do provide a common localization which users can override.

The change implements the Unicode CLDR Periods concept to achieve this (see http://www.unicode.org/reports/tr35/tr35-15.html#DayPeriodRules) to cater for cultures that split the day into more than 2 periods.

Note I have changed our default text from lowercase to uppercase AM/PM. POSIX, Unicode, Windows and Mac all default to uppercase, the POSIX %p format symbol is defined as uppercase, with the more recent %P defined as lowercase.

The KDayPeriod class and accessor methods are private for now, but may be exported later if needed.

The KCM will be modified to allow users to override the value in a later change.

See review http://svn.reviewboard.kde.org/r/5639/

File Changes

Added 2 files
  • /trunk/KDE/kdelibs/kdecore/date
  •   /kdayperiod.cpp
  •   /kdayperiod_p.h
Modified 11 files
  • /trunk/KDE/kdelibs/kdecore
  •   /CMakeLists.txt
  •   /date/kdatetimeformatter.cpp
  •   /localization/klocale.cpp
  •   /localization/klocale.h
  •   /localization/klocale_kde.cpp
  •   /localization/klocale_mac.cpp
  •   /localization/klocale_p.h
  •   /localization/klocale_win.cpp
  •   /tests/klocaletest.cpp
  •   /tests/klocaletest.h
  •   /tests/klocaletimeformattest.cpp
13 files changed in total