← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1558643 into lp:ubuntu-calendar-app

 

Arthur Mello has proposed merging lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1558643 into lp:ubuntu-calendar-app.

Commit message:
Enable translators to changes year/month position on year and week views

Requested reviews:
  Ubuntu Calendar Developers (ubuntu-calendar-dev)
Related bugs:
  Bug #1558643 in Ubuntu Calendar App: "Year and Month order should be adjustable for translations"
  https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1558643

For more details, see:
https://code.launchpad.net/~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1558643/+merge/293321

Enable translators to changes year/month position on year and week views
-- 
Your team Ubuntu Calendar Developers is requested to review the proposed merge of lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_1558643 into lp:ubuntu-calendar-app.
=== modified file 'MonthComponent.qml'
--- MonthComponent.qml	2016-04-28 13:44:33 +0000
+++ MonthComponent.qml	2016-04-28 20:25:20 +0000
@@ -40,8 +40,8 @@
 
     property string dayLabelFontSize: "medium"
     property string dateLabelFontSize: "large"
-    property string monthLabelFontSize: "large"
-    property string yearLabelFontSize: "large"
+    property string leftLabelFontSize: "large"
+    property string rightLabelFontSize: "large"
 
     signal monthSelected(var date);
     signal dateSelected(var date);
@@ -140,7 +140,7 @@
 
         Loader {
             width: parent.width
-            height: isYearView ? FontUtils.sizeToPixels(root.monthLabelFontSize) : 0;
+            height: isYearView ? FontUtils.sizeToPixels(root.leftLabelFontSize) : 0;
             sourceComponent: isYearView ? headerComp : undefined
             Component{
                 id: headerComp
@@ -151,8 +151,8 @@
                     year: root.currentYear
                     daysInMonth: intern.daysInStartMonth
 
-                    monthLabelFontSize: root.monthLabelFontSize
-                    yearLabelFontSize: root.yearLabelFontSize
+                    leftLabelFontSize: root.leftLabelFontSize
+                    rightLabelFontSize: root.rightLabelFontSize
                 }
             }
         }

=== modified file 'ViewHeader.qml'
--- ViewHeader.qml	2016-03-02 19:55:52 +0000
+++ ViewHeader.qml	2016-04-28 20:25:20 +0000
@@ -22,19 +22,19 @@
 Item{
     id: header
     width: parent.width
-    height: monthLabel.height
+    height: leftLabel.height
 
     property int month;
     property int year;
     property int daysInMonth;
 
-    property string monthLabelFontSize: "large"
-    property string yearLabelFontSize: "large"
+    property string leftLabelFontSize: "large"
+    property string rightLabelFontSize: "large"
 
     Label{
-        id: monthLabel
-        objectName: "monthLabel"
-        fontSize: monthLabelFontSize
+        id: leftLabel
+        objectName: "leftLabel"
+        fontSize: leftLabelFontSize
         anchors.leftMargin: units.gu(1)
         anchors.left: parent.left
         color:"black"
@@ -42,9 +42,9 @@
     }
 
     Label{
-        id: yearLabel
-        objectName: "yearLabel"
-        fontSize: yearLabelFontSize
+        id: rightLabel
+        objectName: "rightLabel"
+        fontSize: rightLabelFontSize
         anchors.right: parent.right
         anchors.rightMargin: units.gu(1)
         color:"black"
@@ -52,20 +52,30 @@
     }
 
     Component.onCompleted:  {
-        yearLabel.text = Qt.binding(function(){
+        rightLabel.text = Qt.binding(function(){
+            var labelDate = new Date(year, month)
+
             if (mainView.displayLunarCalendar) {
                 var lunarDate = Lunar.calendar.solar2lunar(year, month + 1, daysInMonth)
                 return lunarDate.gzYear
             } else {
-                return  year
+                // TRANSLATORS: this is a time formatting string,
+                // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+                // It's used in the right label for month's header at the Year's view. 
+                return labelDate.toLocaleString(Qt.locale(), i18n.tr("yyyy"))
             }
         })
-        monthLabel.text = Qt.binding(function(){
+        leftLabel.text = Qt.binding(function(){
+            var labelDate = new Date(year, month)
+
             if (mainView.displayLunarCalendar) {
                 var lunarDate = Lunar.calendar.solar2lunar(year, month + 1, daysInMonth)
                 return lunarDate.IMonthCn
             } else {
-                return Qt.locale().standaloneMonthName(month)
+                // TRANSLATORS: this is a time formatting string,
+                // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+                // It's used in the left label for month's header at the Year's view. 
+                return labelDate.toLocaleString(Qt.locale(), i18n.tr("MMMM"))
             }
         })
     }

=== modified file 'WeekView.qml'
--- WeekView.qml	2016-03-17 01:51:25 +0000
+++ WeekView.qml	2016-04-28 20:25:20 +0000
@@ -137,9 +137,13 @@
                 if (currentLastDayOfWeek.getMonth() !== currentFirstDayOfWeek.getMonth()) {
                     var firstMonthName = currentFirstDayOfWeek.toLocaleString(Qt.locale(),i18n.tr("MMM"))
                     var lastMonthName = currentLastDayOfWeek.toLocaleString(Qt.locale(),i18n.tr("MMM"))
-                    return (firstMonthName[0].toUpperCase() + firstMonthName.substr(1, 2) + "/" +
-                            lastMonthName[0].toUpperCase() + lastMonthName.substr(1, 2) + " " +
-                            currentLastDayOfWeek.getFullYear())
+                    var firstLastMonthStr = firstMonthName[0].toUpperCase() + firstMonthName.substr(1, 2) +
+                                            "/" +
+                                            lastMonthName[0].toUpperCase() + lastMonthName.substr(1, 2)
+                    // TRANSLATORS: This is displayed on week view when the current displayed week starts
+                    // and ends on different months. %1 is the place holder displaying months text and %2
+                    // is the place holder displaying year
+                    return i18n.tr("%1 %2").arg(firstLastMonthStr).arg(currentLastDayOfWeek.getFullYear())
                 } else {
                     var monthName = currentDate.toLocaleString(Qt.locale(),i18n.tr("MMMM yyyy"))
                     return monthName[0].toUpperCase() + monthName.substr(1, monthName.length - 1)

=== modified file 'YearViewDelegate.qml'
--- YearViewDelegate.qml	2016-03-02 19:55:52 +0000
+++ YearViewDelegate.qml	2016-04-28 20:25:20 +0000
@@ -56,8 +56,8 @@
             isYearView: true
             dayLabelFontSize:"x-small"
             dateLabelFontSize: "medium"
-            monthLabelFontSize: "medium"
-            yearLabelFontSize: "medium"
+            leftLabelFontSize: "medium"
+            rightLabelFontSize: "medium"
             onMonthSelected: {
                 yearView.monthSelected(date);
             }

=== modified file 'po/com.ubuntu.calendar.pot'
--- po/com.ubuntu.calendar.pot	2016-03-23 03:59:15 +0000
+++ po/com.ubuntu.calendar.pot	2016-04-28 20:25:20 +0000
@@ -1,6 +1,6 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR Canonical Ltd.
-# This file is distributed under the same license as the PACKAGE package.
+# This file is distributed under the same license as the  package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 #, fuzzy
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 00:58-0300\n"
+"POT-Creation-Date: 2016-04-28 17:20-0300\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -18,7 +18,7 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
 
-#: ../AgendaView.qml:50 ../calendar.qml:344 ../calendar.qml:576
+#: ../AgendaView.qml:50 ../calendar.qml:348 ../calendar.qml:580
 msgid "Agenda"
 msgstr ""
 
@@ -104,7 +104,7 @@
 msgstr ""
 
 #: ../ColorPickerDialog.qml:55 ../DeleteConfirmationDialog.qml:60
-#: ../EditEventConfirmationDialog.qml:53 ../NewEvent.qml:341
+#: ../EditEventConfirmationDialog.qml:53 ../NewEvent.qml:331
 msgid "Cancel"
 msgstr ""
 
@@ -116,14 +116,14 @@
 msgid "Search contact"
 msgstr ""
 
-#: ../DayView.qml:72 ../MonthView.qml:50 ../WeekView.qml:55 ../YearView.qml:57
+#: ../DayView.qml:72 ../MonthView.qml:48 ../WeekView.qml:55 ../YearView.qml:57
 msgid "Today"
 msgstr ""
 
 #. TRANSLATORS: this is a time formatting string,
 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
 #. It's used in the header of the month and week views
-#: ../DayView.qml:122 ../MonthView.qml:78 ../WeekView.qml:144
+#: ../DayView.qml:122 ../MonthView.qml:76 ../WeekView.qml:148
 msgid "MMMM yyyy"
 msgstr ""
 
@@ -154,11 +154,11 @@
 msgid "Delete this"
 msgstr ""
 
-#: ../DeleteConfirmationDialog.qml:51 ../NewEvent.qml:348
+#: ../DeleteConfirmationDialog.qml:51 ../NewEvent.qml:338
 msgid "Delete"
 msgstr ""
 
-#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:336
+#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:326
 msgid "Edit Event"
 msgstr ""
 
@@ -182,12 +182,12 @@
 
 #. TRANSLATORS: the first argument (%1) refers to a start time for an event,
 #. while the second one (%2) refers to the end time
-#: ../EventBubble.qml:100
+#: ../EventBubble.qml:136
 #, qt-format
 msgid "%1 - %2"
 msgstr ""
 
-#: ../EventDetails.qml:37 ../NewEvent.qml:484
+#: ../EventDetails.qml:37 ../NewEvent.qml:496
 msgid "Event Details"
 msgstr ""
 
@@ -195,32 +195,36 @@
 msgid "Edit"
 msgstr ""
 
-#: ../EventDetails.qml:164 ../TimeLineHeader.qml:66
+#: ../EventDetails.qml:176 ../TimeLineHeader.qml:66
 msgid "All Day"
 msgstr ""
 
-#: ../EventDetails.qml:336 ../NewEvent.qml:549
+#: ../EventDetails.qml:351 ../NewEvent.qml:562
 #: com.ubuntu.calendar_calendar.desktop.in.in.h:1
 msgid "Calendar"
 msgstr ""
 
-#: ../EventDetails.qml:369
+#: ../EventDetails.qml:395
+msgid "Attending"
+msgstr ""
+
+#: ../EventDetails.qml:397
 msgid "Not Attending"
 msgstr ""
 
-#: ../EventDetails.qml:373
-msgid "Attending"
+#: ../EventDetails.qml:399
+msgid "Maybe"
 msgstr ""
 
-#: ../EventDetails.qml:377
+#: ../EventDetails.qml:401
 msgid "No Reply"
 msgstr ""
 
-#: ../EventDetails.qml:400 ../NewEvent.qml:515
+#: ../EventDetails.qml:440 ../NewEvent.qml:528
 msgid "Description"
 msgstr ""
 
-#: ../EventDetails.qml:418 ../EventReminder.qml:36 ../NewEvent.qml:711
+#: ../EventDetails.qml:467 ../NewEvent.qml:721 ../NewEvent.qml:760
 msgid "Reminder"
 msgstr ""
 
@@ -228,7 +232,7 @@
 #. and it is shown as the header of the page to choose repetition
 #. and as the header of the list item that shows the repetition
 #. summary in the page that displays the event details
-#: ../EventRepetition.qml:40 ../EventRepetition.qml:153
+#: ../EventRepetition.qml:40 ../EventRepetition.qml:152
 msgid "Repeat"
 msgstr ""
 
@@ -236,18 +240,18 @@
 msgid "Repeats On:"
 msgstr ""
 
-#: ../EventRepetition.qml:217
+#: ../EventRepetition.qml:218
 msgid "Recurring event ends"
 msgstr ""
 
 #. TRANSLATORS: this refers to how often a recurrent event repeats
 #. and it is shown as the header of the option selector to choose
 #. its repetition
-#: ../EventRepetition.qml:240 ../NewEvent.qml:685
+#: ../EventRepetition.qml:242 ../NewEvent.qml:697
 msgid "Repeats"
 msgstr ""
 
-#: ../EventRepetition.qml:265
+#: ../EventRepetition.qml:268
 msgid "Date"
 msgstr ""
 
@@ -288,60 +292,63 @@
 
 #. TRANSLATORS: This is shown in the month view as "Wk" as a title
 #. to indicate the week numbers. It should be a max of up to 3 characters.
-#: ../MonthComponent.qml:317
+#: ../MonthComponent.qml:281
 msgid "Wk"
 msgstr ""
 
-#: ../MonthView.qml:73 ../WeekView.qml:131
+#. TRANSLATORS: This is displayed on week view when the current displayed week starts
+#. and ends on different months. %1 is the place holder displaying months text and %2
+#. is the place holder displaying year
+#: ../MonthView.qml:71 ../WeekView.qml:131 ../WeekView.qml:146
 #, qt-format
 msgid "%1 %2"
 msgstr ""
 
-#: ../NewEvent.qml:179
+#: ../NewEvent.qml:185
 msgid "End time can't be before start time"
 msgstr ""
 
-#: ../NewEvent.qml:336 ../NewEventBottomEdge.qml:53
+#: ../NewEvent.qml:326 ../NewEventBottomEdge.qml:53
 msgid "New Event"
 msgstr ""
 
-#: ../NewEvent.qml:365
+#: ../NewEvent.qml:355
 msgid "Save"
 msgstr ""
 
-#: ../NewEvent.qml:376
+#: ../NewEvent.qml:366
 msgid "Error"
 msgstr ""
 
-#: ../NewEvent.qml:378
+#: ../NewEvent.qml:368
 msgid "OK"
 msgstr ""
 
-#: ../NewEvent.qml:438
+#: ../NewEvent.qml:430
 msgid "From"
 msgstr ""
 
-#: ../NewEvent.qml:451
+#: ../NewEvent.qml:446
 msgid "To"
 msgstr ""
 
-#: ../NewEvent.qml:468
+#: ../NewEvent.qml:473
 msgid "All day event"
 msgstr ""
 
-#: ../NewEvent.qml:497
+#: ../NewEvent.qml:510
 msgid "Event Name"
 msgstr ""
 
-#: ../NewEvent.qml:534
+#: ../NewEvent.qml:547
 msgid "Location"
 msgstr ""
 
-#: ../NewEvent.qml:589
+#: ../NewEvent.qml:603
 msgid "Guests"
 msgstr ""
 
-#: ../NewEvent.qml:598
+#: ../NewEvent.qml:613
 msgid "Add Guest"
 msgstr ""
 
@@ -450,6 +457,20 @@
 msgid "W%1"
 msgstr ""
 
+#. TRANSLATORS: this is a time formatting string,
+#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+#. It's used in the right label for month's header at the Year's view.
+#: ../ViewHeader.qml:65
+msgid "yyyy"
+msgstr ""
+
+#. TRANSLATORS: this is a time formatting string,
+#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+#. It's used in the left label for month's header at the Year's view.
+#: ../ViewHeader.qml:78
+msgid "MMMM"
+msgstr ""
+
 #: ../WeekView.qml:138 ../WeekView.qml:139
 msgid "MMM"
 msgstr ""
@@ -466,19 +487,19 @@
 "about them"
 msgstr ""
 
-#: ../calendar.qml:312 ../calendar.qml:492
+#: ../calendar.qml:316 ../calendar.qml:496
 msgid "Year"
 msgstr ""
 
-#: ../calendar.qml:320 ../calendar.qml:513
+#: ../calendar.qml:324 ../calendar.qml:517
 msgid "Month"
 msgstr ""
 
-#: ../calendar.qml:328 ../calendar.qml:534
+#: ../calendar.qml:332 ../calendar.qml:538
 msgid "Week"
 msgstr ""
 
-#: ../calendar.qml:336 ../calendar.qml:555
+#: ../calendar.qml:340 ../calendar.qml:559
 msgid "Day"
 msgstr ""
 


Follow ups