Merge lp:~dpm/ubuntu-calendar-app/i18n-datetime-improvements into lp:ubuntu-calendar-app

Proposed by David Planella
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 468
Merged at revision: 468
Proposed branch: lp:~dpm/ubuntu-calendar-app/i18n-datetime-improvements
Merge into: lp:ubuntu-calendar-app
Diff against target: 152 lines (+25/-13)
7 files modified
AllDayEventComponent.qml (+1/-1)
DayView.qml (+5/-1)
EventDetails.qml (+10/-7)
EventUtils.qml (+1/-1)
MonthView.qml (+4/-0)
NewEvent.qml (+3/-3)
WeekView.qml (+1/-0)
To merge this branch: bzr merge lp:~dpm/ubuntu-calendar-app/i18n-datetime-improvements
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+235401@code.launchpad.net

Commit message

Internationalization improvements

Description of the change

This branch adds some i18n improvements:
- Reduce the work of translators by using standard Qt.Locale() translations
- Make some translatable strings consistent across files
- Add translator comments
- Use plural forms where necessary

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AllDayEventComponent.qml'
2--- AllDayEventComponent.qml 2014-09-20 10:45:35 +0000
3+++ AllDayEventComponent.qml 2014-09-21 09:42:47 +0000
4@@ -115,7 +115,7 @@
5 text = i18n.tr("%1 Ev.").arg(events.length)
6 } else {
7 if( events.length > 1) {
8- text = i18n.tr("%1 All day events").arg(events.length)
9+ text = i18n.tr("%1 All day event", "%1 All day events", events.length).arg(events.length)
10 } else {
11 text = events[0].displayLabel;
12 }
13
14=== modified file 'DayView.qml'
15--- DayView.qml 2014-09-19 12:28:53 +0000
16+++ DayView.qml 2014-09-21 09:42:47 +0000
17@@ -54,13 +54,17 @@
18
19 Label {
20 fontSize: "medium"
21- text: i18n.tr(currentDay.toLocaleString(Qt.locale(),i18n.tr("dddd")))
22+ text: Qt.locale().standaloneDayName(currentDay.getDay())
23+ font.capitalization: Font.Capitalize
24 }
25
26 Label {
27 id:cuurentDay
28 objectName:"monthYearLabel"
29 fontSize: "large"
30+ // TRANSLATORS: this is a time formatting string,
31+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
32+ // It's used in the header of the day view
33 text:i18n.tr(currentDay.toLocaleString(Qt.locale(),i18n.tr("MMMM dd, yyyy")))
34 }
35 }
36
37=== modified file 'EventDetails.qml'
38--- EventDetails.qml 2014-09-17 21:33:23 +0000
39+++ EventDetails.qml 2014-09-21 09:42:47 +0000
40@@ -119,10 +119,13 @@
41 function showEvent(e) {
42 // TRANSLATORS: this is a time formatting string,
43 // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions
44- var timeFormat = i18n.tr("hh:mm");
45- // TRANSLATORS: this is a time & Date formatting string,
46- //see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details
47- var dateFormat = i18n.tr("dd-MMM-yyyy")
48+ // It's used to display the start and end times of an event in the event details
49+ // and new event views
50+ var timeFormat = Qt.locale().timeFormat(Locale.ShortFormat);
51+ // TRANSLATORS: this is a date formatting string,
52+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions
53+ // It's used to display the date in the event details view
54+ var dateFormat = i18n.tr("MMMM dd, yyyy")
55 eventDate.value = e.startDateTime.toLocaleString(Qt.locale(),dateFormat);
56 var startTime = e.startDateTime.toLocaleTimeString(Qt.locale(), timeFormat);
57 var endTime = e.endDateTime.toLocaleTimeString(Qt.locale(), timeFormat);
58@@ -281,7 +284,7 @@
59 visible: allDayEventCheckbox.checked
60
61 Label {
62- text: i18n.tr("All Day event:")
63+ text: i18n.tr("All day event")
64 anchors.verticalCenter: allDayEventCheckbox.verticalCenter
65 color: headerColor
66 }
67@@ -394,12 +397,12 @@
68 EventDetailsInfo{
69 id: recurrentHeader
70 xMargin: column.recurranceAreaMaxWidth
71- header: i18n.tr("This happens")
72+ header: i18n.tr("Repeats")
73 }
74 EventDetailsInfo{
75 id: reminderHeader
76 xMargin: column.recurranceAreaMaxWidth
77- header: i18n.tr("Remind me")
78+ header: i18n.tr("Reminder")
79 }
80
81 }
82
83=== modified file 'EventUtils.qml'
84--- EventUtils.qml 2014-09-16 11:35:18 +0000
85+++ EventUtils.qml 2014-09-21 09:42:47 +0000
86@@ -78,7 +78,7 @@
87 var index;
88 var reccurence = "";
89 var limit,str = "";
90- var dateFormat = i18n.tr("ddd MMMM d yyyy");
91+ var dateFormat = Qt.locale().dateFormat(Locale.LongFormat);
92 index = rule.frequency;
93 if(index === RecurrenceRule.Weekly){
94 index = getWeekDaysIndex(rule.daysOfWeek.sort() )
95
96=== modified file 'MonthView.qml'
97--- MonthView.qml 2014-09-19 15:10:04 +0000
98+++ MonthView.qml 2014-09-21 09:42:47 +0000
99@@ -50,7 +50,11 @@
100
101 contents: Label {
102 fontSize: "x-large"
103+ // TRANSLATORS: this is a time formatting string,
104+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
105+ // It's used in the header of the month and week views
106 text: i18n.tr(currentMonth.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
107+ font.capitalization: Font.Capitalize
108 }
109 }
110
111
112=== modified file 'NewEvent.qml'
113--- NewEvent.qml 2014-09-20 10:45:35 +0000
114+++ NewEvent.qml 2014-09-21 09:42:47 +0000
115@@ -78,7 +78,7 @@
116 if (typeof(endDate) === 'undefined') {
117 endDate = new Date(root.roundDate(date))
118 endDate.setMinutes(endDate.getMinutes() + 30)
119- endTimeInput.text = Qt.formatDateTime(endDate, "hh:mm");
120+ endTimeInput.text = Qt.formatDateTime(endDate, Qt.locale().timeFormat(Locale.ShortFormat));
121 }
122
123 if(event === null){
124@@ -426,7 +426,7 @@
125 leftMargin: units.gu(-1)
126 }
127
128- text: "All Day Event"
129+ text: i18n.tr("All day event")
130 showDivider: false
131 control: CheckBox {
132 id: allDayEventCheckbox
133@@ -601,7 +601,7 @@
134 showDivider: false
135 progression: true
136 visible: event.itemType === Type.Event
137- text: i18n.tr("This Happens")
138+ text: i18n.tr("Repeats")
139 subText: eventUtils.getRecurrenceString(rule)
140 onClicked: pageStack.push(Qt.resolvedUrl("EventRepetition.qml"),{"rule": rule,"date":date,"isEdit":isEdit});
141 }
142
143=== modified file 'WeekView.qml'
144--- WeekView.qml 2014-09-19 09:40:55 +0000
145+++ WeekView.qml 2014-09-21 09:42:47 +0000
146@@ -58,6 +58,7 @@
147 objectName:"monthYearLabel"
148 fontSize: "x-large"
149 text: i18n.tr(dayStart.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy")))
150+ font.capitalization: Font.Capitalize
151 }
152 }
153

Subscribers

People subscribed via source and target branches

to status/vote changes: