~timo-jyrinki/ubuntu-calendar-app/use_pickerpanelworkaround_lp1351024

« back to all changes in this revision

Viewing changes to EventDetails.qml

  • Committer: Tarmac
  • Author(s): David Planella, Kunal Parmar
  • Date: 2014-08-03 02:28:18 UTC
  • mfrom: (371.2.7 i18n-improvements)
  • Revision ID: tarmac-20140803022818-oy3k1ffweew7wa3t
Several improvements and fixes to make strings translatable.

Approved by Ubuntu Phone Apps Jenkins Bot, Mihir Soni.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
    flickable: null
26
26
 
27
 
    title: "Event Details"
 
27
    title: i18n.tr("Event Details")
28
28
 
29
29
    Component.onCompleted: {
30
30
 
54
54
                if(recurrenceRule[0].limit === undefined)
55
55
                    limitHeader.value = i18n.tr("Never");
56
56
                else{
57
 
                    // TRANSLATORS: this is a time & Date formatting string,
58
 
                    //see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details
59
 
                    var dateFormat = i18n.tr("dd-MMM-yyyy")
60
 
                    // TRANSLATORS: This refers to no of occurences of an event.
 
57
                    // TRANSLATORS: this is a date shown in the event details view,
 
58
                    // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details
 
59
                    var dateFormat = i18n.tr("ddd MMMM d yyyy");
 
60
                    // TRANSLATORS: This refers to the number of occurences of an event.
61
61
                    limitHeader.value = parseInt(recurrenceRule[0].limit) ?
62
 
                                i18n.tr("After %1 Occurrences", recurrenceRule[0].limit).arg(recurrenceRule[0].limit):
63
 
                                i18n.tr("After Date %1", recurrenceRule[0].limit.toLocaleString(Qt.locale(),dateFormat)).arg(recurrenceRule[0].limit.toLocaleString(Qt.locale(),dateFormat));
 
62
                                i18n.tr("After %1 Occurrence", "After %1 Occurrences", recurrenceRule[0].limit).arg(recurrenceRule[0].limit):
 
63
                                i18n.tr("After Date %1".arg(recurrenceRule[0].limit.toLocaleString(Qt.locale(), dateFormat)));
64
64
                }
65
65
 
66
66
                index =  recurrenceRule[0].frequency ;
67
 
                if(index === RecurrenceRule.Weekly ){
 
67
                if (index === RecurrenceRule.Weekly) {
68
68
                    var sorted = recurrenceRule[0].daysOfWeek.sort();
69
 
                    var val = i18n.tr("Every ")
70
 
                    for(var j=0;j<sorted.length;++j){
71
 
                        val += Qt.locale().dayName(sorted[j],Locale.LongFormat) + " ,"
 
69
                    var val = "";
 
70
                    for (var j=0; j<sorted.length; ++j) {
 
71
                        val += Qt.locale().dayName(sorted[j], Locale.ShortFormat) + ", ";
72
72
                    }
73
 
                    weekDaysHeader.value = val.slice(0,-1) // Trim last comma from the string
 
73
                    val = val.slice(0, -2); // Trim last comma from the string
 
74
                    // TRANSLATORS: the argument is a day of the week or a list of days
 
75
                    var recurrence = i18n.tr("Every %1".arg(val));
 
76
                    weekDaysHeader.value = recurrence;
74
77
                    weekDaysHeader.visible = true;
75
78
                }
76
79
            }