Debian Codegraph @

tests/unit/i18n13/LocalizedApp/src/LocalizedApp.qml

raw
1 /*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 import QtQuick 2.0
18 import Lomiri.Components 1.3
19
20 MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 applicationName: 'localizedApp'
24
25 Page {
26 objectName: 'page'
27 title: i18n.dtr('localizedApp', "Welcome")
28 Button {
29 id: button
30 objectName: 'button'
31 anchors.horizontalCenter: parent.horizontalCenter
32 text: i18n.tr('Count the kilometres')
33 width: units.gu(15)
34 }
35 Button {
36 id: button2
37 objectName: 'button2'
38 anchors.top: button.bottom
39 text: i18n.tag('Count the kittens')
40 width: units.gu(15)
41 }
42 Label {
43 id: all1
44 objectName: 'all1'
45 anchors.top: button2.bottom
46 anchors.horizontalCenter: button.horizontalCenter
47 text: i18n.ctr('All Contacts', 'All')
48 }
49 Label {
50 id: all2
51 objectName: 'all2'
52 anchors.top: all1.bottom
53 anchors.horizontalCenter: all1.horizontalCenter
54 text: i18n.ctr('All Calls', 'All')
55 }
56 Label {
57 id: all3
58 objectName: 'all3'
59 anchors.top: all2.bottom
60 anchors.horizontalCenter: all2.horizontalCenter
61 text: i18n.tag('All Cats', 'All')
62 }
63 Label {
64 id: timeNow
65 objectName: 'timeNow'
66 anchors.top: all3.bottom
67 anchors.horizontalCenter: all3.horizontalCenter
68 text: i18n.relativeDateTime(new Date())
69 }
70 Label {
71 id: timeMinuteBefore
72 objectName: 'timeMinuteBefore'
73 anchors.top: timeNow.bottom
74 anchors.horizontalCenter: timeNow.horizontalCenter
75 text: i18n.relativeDateTime(new Date(new Date().getTime() - 60000))
76 }
77 Label {
78 id: timeMinuteAfter
79 objectName: 'timeMinuteAfter'
80 anchors.top: timeMinuteBefore.bottom
81 anchors.horizontalCenter: timeMinuteBefore.horizontalCenter
82 text: i18n.relativeDateTime(new Date(new Date().getTime() + 60000))
83 }
84 Label {
85 id: tenMinutesBefore
86 objectName: 'tenMinutesBefore'
87 anchors.top: timeMinuteAfter.bottom
88 anchors.horizontalCenter: timeMinuteAfter.horizontalCenter
89 text: i18n.relativeDateTime(new Date(new Date().getTime() - 600000))
90 }
91 Label {
92 id: tenMinutesAfter
93 objectName: 'tenMinutesAfter'
94 anchors.top: tenMinutesBefore.bottom
95 anchors.horizontalCenter: tenMinutesBefore.horizontalCenter
96 text: i18n.relativeDateTime(new Date(new Date().getTime() + 600000))
97 }
98 Label {
99 id: timeFarAway
100 objectName: 'timeFarAway'
101 anchors.top: tenMinutesAfter.bottom
102 anchors.horizontalCenter: tenMinutesAfter.horizontalCenter
103 text: i18n.relativeDateTime(new Date(2000, 0, 1, 0, 0, 0, 0))
104 }
105 }
106 }