on xenial help sign in
Add some context to tr calls

Fixes: #1431497 Approved by: GunChleoc, Michael Zanetti

commit6eef43407d55c0ae5ba2e01ed4e3479a737d92e4 authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 18 Mar 2015, 10:18 (12 years ago) parent488b30e213ee30
11 files changed+73−188
po/unity8.pot+50−22 po/update-unity-pot+1 qml/Components/Dialogs.qml+10−10 qml/Dash/GenericScopeView.qml+1−1 qml/Dash/PageHeader.qml+3−3 qml/Panel/Indicators/MessageMenuItemFactory.qml+1−1 qml/Panel/SearchIndicator.qml−82 qml/Wizard/Page.qml+1−1 qml/Wizard/Pages/30-passwd-type.qml+6−6 tests/qmltests/CMakeLists.txt−1 tests/qmltests/Panel/tst_SearchIndicator.qml−61
po/unity8.pot+50−22
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2015-02-25 08:57-0500\n"
11+"POT-Creation-Date: 2015-03-13 11:06+0100\n"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -50,70 +50,84 @@ msgid_plural "Please wait %1 minutes and then try again…"
5050msgstr[0] ""
5151msgstr[1] ""
5252
53−#: qml/Components/Dialogs.qml:87
53+#: qml/Components/Dialogs.qml:67
54+msgctxt "Title: Lock/Log out dialog"
5455msgid "Log out"
5556msgstr ""
5657
57−#: qml/Components/Dialogs.qml:88
58+#: qml/Components/Dialogs.qml:68
5859msgid "Are you sure you want to log out?"
5960msgstr ""
6061
61−#: qml/Components/Dialogs.qml:90
62+#: qml/Components/Dialogs.qml:70
63+msgctxt "Button: Lock the system"
6264msgid "Lock"
6365msgstr ""
6466
65−#: qml/Components/Dialogs.qml:97
67+#: qml/Components/Dialogs.qml:77
68+msgctxt "Button: Log out from the system"
6669msgid "Log Out"
6770msgstr ""
6871
69−#: qml/Components/Dialogs.qml:104 qml/Components/Dialogs.qml:135
70−#: qml/Components/Dialogs.qml:191
72+#: qml/Components/Dialogs.qml:84 qml/Components/Dialogs.qml:115
73+#: qml/Components/Dialogs.qml:171
7174msgid "Cancel"
7275msgstr ""
7376
74−#: qml/Components/Dialogs.qml:116
77+#: qml/Components/Dialogs.qml:96
78+msgctxt "Title: Reboot/Shut down dialog"
7579msgid "Shut down"
7680msgstr ""
7781
78−#: qml/Components/Dialogs.qml:117
82+#: qml/Components/Dialogs.qml:97
7983msgid "Are you sure you want to shut down?"
8084msgstr ""
8185
82−#: qml/Components/Dialogs.qml:119 qml/Components/Dialogs.qml:147
86+#: qml/Components/Dialogs.qml:99
87+msgctxt "Button: Reboot the system"
8388msgid "Reboot"
8489msgstr ""
8590
91+#: qml/Components/Dialogs.qml:107
92+msgctxt "Button: Shut down the system"
93+msgid "Shut down"
94+msgstr ""
95+
8696#: qml/Components/Dialogs.qml:127
87−msgid "Shutdown"
97+msgctxt "Title: Reboot dialog"
98+msgid "Reboot"
8899msgstr ""
89100
90−#: qml/Components/Dialogs.qml:148
101+#: qml/Components/Dialogs.qml:128
91102msgid "Are you sure you want to reboot?"
92103msgstr ""
93104
94−#: qml/Components/Dialogs.qml:150
105+#: qml/Components/Dialogs.qml:130
95106msgid "No"
96107msgstr ""
97108
98−#: qml/Components/Dialogs.qml:156
109+#: qml/Components/Dialogs.qml:136
99110msgid "Yes"
100111msgstr ""
101112
102−#: qml/Components/Dialogs.qml:170
113+#: qml/Components/Dialogs.qml:150
114+msgctxt "Title: Power off/Restart dialog"
103115msgid "Power"
104116msgstr ""
105117
106−#: qml/Components/Dialogs.qml:171
118+#: qml/Components/Dialogs.qml:151
107119msgid ""
108120"Are you sure you would like\n"
109121"to power off?"
110122msgstr ""
111123
112−#: qml/Components/Dialogs.qml:173
124+#: qml/Components/Dialogs.qml:153
125+msgctxt "Button: Power off the system"
113126msgid "Power off"
114127msgstr ""
115128
116−#: qml/Components/Dialogs.qml:182
129+#: qml/Components/Dialogs.qml:162
130+msgctxt "Button: Restart the system"
117131msgid "Restart"
118132msgstr ""
119133
@@ -129,23 +143,29 @@ msgstr ""
129143msgid "OK"
130144msgstr ""
131145
132−#: qml/Dash/GenericScopeView.qml:528 qml/Dash/GenericScopeView.qml:686
146+#: qml/Dash/GenericScopeView.qml:533 qml/Dash/GenericScopeView.qml:691
133147msgid "See less"
134148msgstr ""
135149
136−#: qml/Dash/GenericScopeView.qml:528
150+#: qml/Dash/GenericScopeView.qml:533
137151msgid "See all"
138152msgstr ""
139153
140−#: qml/Dash/GenericScopeView.qml:590 qml/Dash/PageHeader.qml:276
141−#: qml/Panel/SearchIndicator.qml:27
154+#: qml/Dash/GenericScopeView.qml:595
155+msgctxt "Label: Hint for dash search line edit"
142156msgid "Search"
143157msgstr ""
144158
145159#: qml/Dash/PageHeader.qml:269
160+msgctxt "Button: The Ubuntu Store"
146161msgid "Store"
147162msgstr ""
148163
164+#: qml/Dash/PageHeader.qml:276
165+msgctxt "Button: Shown in Page Header Menu"
166+msgid "Search"
167+msgstr ""
168+
149169#: qml/Dash/PageHeader.qml:286
150170msgid "Settings"
151171msgstr ""
@@ -309,6 +329,7 @@ msgid "Failed, tap to retry"
309329msgstr ""
310330
311331#: qml/Panel/Indicators/MessageMenuItemFactory.qml:149
332+msgctxt "Label: Hint in message indicator line edit"
312333msgid "Reply"
313334msgstr ""
314335
@@ -373,6 +394,7 @@ msgid "View all your running tasks."
373394msgstr ""
374395
375396#: qml/Wizard/Page.qml:89
397+msgctxt "Button: Go back one page in the Wizard"
376398msgid "Back"
377399msgstr ""
378400
@@ -416,26 +438,32 @@ msgid "Please select how you’d like to unlock your phone."
416438msgstr ""
417439
418440#: qml/Wizard/Pages/30-passwd-type.qml:97
441+msgctxt "Label: Type of security method"
419442msgid "Swipe"
420443msgstr ""
421444
422445#: qml/Wizard/Pages/30-passwd-type.qml:98
446+msgctxt "Label: Description of security method"
423447msgid "No security"
424448msgstr ""
425449
426450#: qml/Wizard/Pages/30-passwd-type.qml:100
451+msgctxt "Label: Type of security method"
427452msgid "Passcode"
428453msgstr ""
429454
430455#: qml/Wizard/Pages/30-passwd-type.qml:101
456+msgctxt "Label: Description of security method"
431457msgid "4 digits only"
432458msgstr ""
433459
434460#: qml/Wizard/Pages/30-passwd-type.qml:103
461+msgctxt "Label: Type of security method"
435462msgid "Passphrase"
436463msgstr ""
437464
438465#: qml/Wizard/Pages/30-passwd-type.qml:104
466+msgctxt "Label: Description of security method"
439467msgid "Numbers and letters"
440468msgstr ""
441469
po/update-unity-pot+1
@@ -22,6 +22,7 @@ xgettext \
2222 --keyword=tr \
2323 --keyword=tr:1,2 \
2424 --keyword=dtr:2 \
25+ --keyword=ctr:1c,2 \
2526 --package-name="unity8" \
2627 --copyright-holder="Canonical Ltd." \
2728 --from-code="UTF-8"
qml/Components/Dialogs.qml+10−10
@@ -64,17 +64,17 @@ Item {
6464 id: logoutDialogComponent
6565 ShellDialog {
6666 id: logoutDialog
67− title: i18n.tr("Log out")
67+ title: i18n.ctr("Title: Lock/Log out dialog", "Log out")
6868 text: i18n.tr("Are you sure you want to log out?")
6969 Button {
70− text: i18n.tr("Lock")
70+ text: i18n.ctr("Button: Lock the system", "Lock")
7171 onClicked: {
7272 LightDM.Greeter.showGreeter()
7373 logoutDialog.hide();
7474 }
7575 }
7676 Button {
77− text: i18n.tr("Log Out")
77+ text: i18n.ctr("Button: Log out from the system", "Log Out")
7878 onClicked: {
7979 unitySessionService.logout();
8080 logoutDialog.hide();
@@ -93,10 +93,10 @@ Item {
9393 id: shutdownDialogComponent
9494 ShellDialog {
9595 id: shutdownDialog
96− title: i18n.tr("Shut down")
96+ title: i18n.ctr("Title: Reboot/Shut down dialog", "Shut down")
9797 text: i18n.tr("Are you sure you want to shut down?")
9898 Button {
99− text: i18n.tr("Reboot")
99+ text: i18n.ctr("Button: Reboot the system", "Reboot")
100100 onClicked: {
101101 root.closeAllApps();
102102 unitySessionService.reboot();
@@ -104,7 +104,7 @@ Item {
104104 }
105105 }
106106 Button {
107− text: i18n.tr("Shutdown")
107+ text: i18n.ctr("Button: Shut down the system", "Shut down")
108108 onClicked: {
109109 root.closeAllApps();
110110 unitySessionService.shutdown();
@@ -124,7 +124,7 @@ Item {
124124 id: rebootDialogComponent
125125 ShellDialog {
126126 id: rebootDialog
127− title: i18n.tr("Reboot")
127+ title: i18n.ctr("Title: Reboot dialog", "Reboot")
128128 text: i18n.tr("Are you sure you want to reboot?")
129129 Button {
130130 text: i18n.tr("No")
@@ -147,10 +147,10 @@ Item {
147147 id: powerDialogComponent
148148 ShellDialog {
149149 id: powerDialog
150− title: i18n.tr("Power")
150+ title: i18n.ctr("Title: Power off/Restart dialog", "Power")
151151 text: i18n.tr("Are you sure you would like\nto power off?")
152152 Button {
153− text: i18n.tr("Power off")
153+ text: i18n.ctr("Button: Power off the system", "Power off")
154154 onClicked: {
155155 root.closeAllApps();
156156 powerDialog.hide();
@@ -159,7 +159,7 @@ Item {
159159 color: UbuntuColors.red
160160 }
161161 Button {
162− text: i18n.tr("Restart")
162+ text: i18n.ctr("Button: Restart the system", "Restart")
163163 onClicked: {
164164 root.closeAllApps();
165165 unitySessionService.reboot();
qml/Dash/GenericScopeView.qml+1−1
@@ -592,7 +592,7 @@ FocusScope {
592592 objectName: "scopePageHeader"
593593 width: parent.width
594594 title: scopeView.scope ? scopeView.scope.name : ""
595− searchHint: scopeView.scope && scopeView.scope.searchHint || i18n.tr("Search")
595+ searchHint: scopeView.scope && scopeView.scope.searchHint || i18n.ctr("Label: Hint for dash search line edit", "Search")
596596 showBackButton: scopeView.hasBackAction
597597 searchEntryEnabled: true
598598 settingsEnabled: scopeView.scope && scopeView.scope.settings && scopeView.scope.settings.count > 0 || false
qml/Dash/PageHeader.qml+3−3
@@ -266,14 +266,14 @@ Item {
266266 actions: [
267267 Action {
268268 objectName: "store"
269− text: i18n.tr("Store")
269+ text: i18n.ctr("Button: Open the Ubuntu Store", "Store")
270270 iconName: "ubuntu-store-symbolic"
271271 visible: root.storeEntryEnabled
272272 onTriggered: root.storeClicked();
273273 },
274274 Action {
275275 objectName: "search"
276− text: i18n.tr("Search")
276+ text: i18n.ctr("Button: Start a search in the current dash scope", "Search")
277277 iconName: "search"
278278 visible: root.searchEntryEnabled
279279 onTriggered: {
@@ -283,7 +283,7 @@ Item {
283283 },
284284 Action {
285285 objectName: "settings"
286− text: i18n.tr("Settings")
286+ text: i18n.ctr("Button: Show the current dash scope settings", "Settings")
287287 iconName: "settings"
288288 visible: root.settingsEnabled
289289 onTriggered: root.settingsClicked()
qml/Panel/Indicators/MessageMenuItemFactory.qml+1−1
@@ -146,7 +146,7 @@ Loader {
146146 time: timeFormatter.timeString
147147 body: getExtendedProperty(extendedData, "xCanonicalText", "")
148148 replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
149− replyHintText: i18n.tr("Reply")
149+ replyHintText: i18n.ctr("Label: Hint in message indicator line edit", "Reply")
150150 // icons
151151 avatar: getExtendedProperty(extendedData, "icon", "image://theme/contact")
152152 icon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "image://theme/message")
qml/Panel/SearchIndicator.qmldeleted−82
@@ -1,82 +0,0 @@
1−/*
2− * Copyright (C) 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 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 General Public License for more details.
12− *
13− * You should have received a copy of the GNU 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 Ubuntu.Components 0.1
19−import "../Components"
20−
21−Item {
22− id: search
23−
24− width: container.width + units.gu(2)
25− height: units.gu(3)
26−
27− property string headerText: i18n.tr("Search")
28−
29− signal clicked
30−
31− // eater
32− MouseArea {
33− anchors.fill: parent
34− onClicked: search.clicked()
35− }
36−
37− Row {
38− id: container
39− objectName: "container"
40−
41− height: parent.height
42− width: childrenRect.width
43− anchors {
44− left: parent.left
45− leftMargin: units.gu(1)
46− }
47− spacing: units.gu(1)
48−
49− Behavior on opacity { StandardAnimation { duration: 300 } }
50−
51− Image {
52− id: icon
53− source: "graphics/search.png"
54− anchors.verticalCenter: parent.verticalCenter
55− }
56−
57− Label {
58− text: search.headerText
59− color: Qt.rgba(0.8, 0.8, 0.8, 1.0)
60− fontSize: "small"
61− font.capitalization: Font.AllUppercase
62− anchors.verticalCenter: parent.verticalCenter
63− }
64− }
65−
66− states: [
67− State {
68− name: "visible"
69− PropertyChanges {
70− target: container
71− opacity: 1
72− }
73− },
74− State {
75− name: "hidden"
76− PropertyChanges {
77− target: container
78− opacity: 0
79− }
80− }
81− ]
82−}
qml/Wizard/Page.qml+1−1
@@ -86,7 +86,7 @@ Item {
8686 bottomMargin: buttonMargin
8787 }
8888 z: 1
89− text: i18n.tr("Back")
89+ text: i18n.ctr("Button: Go back one page in the Wizard", "Back")
9090 visible: pageStack.depth > 1 && hasBackButton
9191 backArrow: true
9292
qml/Wizard/Pages/30-passwd-type.qml+6−6
@@ -94,14 +94,14 @@ LocalComponents.Page {
9494 var name = ""
9595 var desc = ""
9696 if (method === UbuntuSecurityPrivacyPanel.Swipe) {
97− name = i18n.tr("Swipe")
98− desc = i18n.tr("No security")
97+ name = i18n.ctr("Label: Type of security method", "Swipe")
98+ desc = i18n.ctr("Label: Description of security method", "No security")
9999 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
100− name = i18n.tr("Passcode")
101− desc = i18n.tr("4 digits only")
100+ name = i18n.ctr("Label: Type of security method", "Passcode")
101+ desc = i18n.ctr("Label: Description of security method", "4 digits only")
102102 } else {
103− name = i18n.tr("Passphrase")
104− desc = i18n.tr("Numbers and letters")
103+ name = i18n.ctr("Label: Type of security method", "Passphrase")
104+ desc = i18n.ctr("Label: Description of security method", "Numbers and letters")
105105 }
106106 return "<b>%1</b> (%2)".arg(name).arg(desc)
107107 }
tests/qmltests/CMakeLists.txt−1
@@ -78,7 +78,6 @@ add_qml_test(Panel IndicatorsBar)
7878add_qml_test(Panel IndicatorsMenu)
7979add_qml_test(Panel MenuContent)
8080add_qml_test(Panel Panel)
81−add_qml_test(Panel SearchIndicator)
8281add_qml_test(Panel/Indicators IndicatorsLight ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
8382# These MenuItemFactory tests need the test/mocks/ to come before plugins/
8483add_qml_test(Panel/Indicators MenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
tests/qmltests/Panel/tst_SearchIndicator.qmldeleted−61
@@ -1,61 +0,0 @@
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 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 General Public License for more details.
12− *
13− * You should have received a copy of the GNU 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 QtTest 1.0
19−import "../../../qml/Panel"
20−import Ubuntu.Components 0.1
21−import Unity.Test 0.1 as UT
22−
23−Item {
24− width: units.gu(9)
25− height: units.gu(3)
26−
27− SignalSpy {
28− id: clickedSpy
29− target: searchIndicator
30− signalName: "clicked"
31− }
32−
33− SearchIndicator {
34− id: searchIndicator
35− anchors.fill: parent
36− }
37−
38− UT.UnityTestCase {
39− name: "SearchIndicator"
40− when: windowShown
41−
42− function test_clickedSignal() {
43− clickedSpy.clear();
44− mouseClick(searchIndicator,
45− searchIndicator.width / 2, searchIndicator.height / 2);
46− compare(clickedSpy.count, 1);
47− }
48−
49− function test_hideUp() {
50− var container = findChild(searchIndicator, "container");
51− searchIndicator.state = "hidden";
52− tryCompare(container, "opacity", 0);
53− }
54−
55− function test_show() {
56− var container = findChild(searchIndicator, "container");
57− searchIndicator.state = "visible";
58− tryCompare(container, "opacity", 1);
59− }
60− }
61−}