Localization aware date display?

asked 2016-02-03 22:14:13 +0300

updated 2016-02-03 22:40:47 +0300

Hello Jolla,

I have localized the Jolla to my native language, but I have not found any references in the translation files for the date formatting. The formatting strings for the time display (hh:mm for e.g.) are present, but nothing is present for the dates.

On the lock screen the date is formatted as "3 febr." although we are used to the "febr. 3" format.

After reading through the lockscreen and the events view qml files, I have realized that the code uses the Format.formatDate method for displaying the date.

That function only accepts only predefined format types. I have "patched" the display method to use the Qt.formatDate method which accepts a format string, which could be localized.

What is the official way to create a patch and push it to upstream?

edit retag flag offensive close delete

Comments

There is another way to do this. And this way doesn't involve any translation string :)

See http://doc.qt.io/qt-5/qtquick-internationalization.html#6-internationalize-dates-times-and-currencies

François ( 2016-02-04 18:00:46 +0300 )edit

No. I am talking about the textfield on the locks screen which displays ONLY the month name and the day number in the month. The toLocaleString could be used to print out a FULL date in local aware format.

To display the month/day only we will need a format specifier. That format specifier is used to passed to the qsTr and then it could be localized.

martonmiklos ( 2016-02-04 18:08:08 +0300 )edit