on xenial help sign in
fix PO files extraction

some previously missing strings can now be translated; also properly mark for extraction "remaining time" strings while using plural forms

commit5135145b88ac16a9e9dceda8b1244b3dc97e12f2 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateSat 13 Jun 2015, 13:30 (11 years ago) parenta2958f0
4 files changed+176−56
plugins/Dash/CardCreator.js+1−1 po/unity8.pot+158−46 po/update-unity-pot+10−3 qml/Panel/Indicators/MenuItemFactory.qml+7−6
plugins/Dash/CardCreator.js+1−1
@@ -245,7 +245,7 @@ var kEmblemIconCode = 'Icon { \n\
245245 anchors { \n\
246246 bottom: titleLabel.baseline; \n\
247247 right: parent.right; \n\
248− %1
248+ %1 \n\
249249 } \n\
250250 source: cardData && cardData["emblem"] || ""; \n\
251251 color: %2; \n\
po/unity8.pot+158−46
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11+"POT-Creation-Date: 2015-06-13 13:25+0200\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"
@@ -31,6 +31,86 @@ msgstr ""
3131msgid "Unpin shortcut"
3232msgstr ""
3333
34+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
35+#. This format string is used for showing, on a 12-hour clock, times that happen yesterday.
36+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
37+#. en_US example: "Yesterday\u2003%l:%M %p" --> "Yesterday 1:00 PM"
38+#: plugins/Utils/relativetimeformatter.cpp:157
39+msgid "Yesterday %l:%M %p"
40+msgstr ""
41+
42+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
43+#. This format string is used for showing, on a 12-hour clock, times that happened today.
44+#. en_US example: "%l:%M %p" --> "1:00 PM"
45+#: plugins/Utils/relativetimeformatter.cpp:164
46+msgid "%l:%M %p"
47+msgstr ""
48+
49+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
50+#. This format string is used for showing, on a 12-hour clock, events/appointments that happen tomorrow.
51+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
52+#. en_US example: "Tomorrow\u2003%l:%M %p" --> "Tomorrow 1:00 PM"
53+#: plugins/Utils/relativetimeformatter.cpp:172
54+msgid "Tomorrow %l:%M %p"
55+msgstr ""
56+
57+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
58+#. This format string is used for showing, on a 12-hour clock, times that happened in the last week.
59+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
60+#. en_US example: "%a\u2003%l:%M %p" --> "Fri 1:00 PM"
61+#: plugins/Utils/relativetimeformatter.cpp:181
62+msgid "%a %l:%M %p"
63+msgstr ""
64+
65+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
66+#. This format string is used for showing, on a 12-hour clock, times that happened before a week from now.
67+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
68+#. en_US example: "%a %d %b\u2003%l:%M %p" --> "Fri Oct 31 1:00 PM"
69+#. en_GB example: "%a %b %d\u2003%l:%M %p" --> "Fri 31 Oct 1:00 PM"
70+#: plugins/Utils/relativetimeformatter.cpp:190
71+msgid "%a %d %b %l:%M %p"
72+msgstr ""
73+
74+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
75+#. This format string is used for showing, on a 24-hour clock, times that happen yesterday.
76+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
77+#. en_US example: "Yesterday\u2003%l:%M %p" --> "Yesterday 13:00"
78+#: plugins/Utils/relativetimeformatter.cpp:201
79+msgid "Yesterday %H:%M"
80+msgstr ""
81+
82+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
83+#. This format string is used for showing, on a 24-hour clock, times that happened today.
84+#. en_US example: "%H:%M" --> "13:00"
85+#: plugins/Utils/relativetimeformatter.cpp:208
86+msgid "%H:%M"
87+msgstr ""
88+
89+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
90+#. This format string is used for showing, on a 24-hour clock, events/appointments that happen tomorrow.
91+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
92+#. en_US example: "Tomorrow\u2003%l:%M %p" --> "Tomorrow 13:00"
93+#: plugins/Utils/relativetimeformatter.cpp:216
94+msgid "Tomorrow %H:%M"
95+msgstr ""
96+
97+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
98+#. This format string is used for showing, on a 24-hour clock, times that happened in the last week.
99+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
100+#. en_US example: "%a\u2003%H:%M" --> "Fri 13:00"
101+#: plugins/Utils/relativetimeformatter.cpp:225
102+msgid "%a %H:%M"
103+msgstr ""
104+
105+#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
106+#. This format string is used for showing, on a 24-hour clock, times that happened before a week from now.
107+#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
108+#. en_US example: "%a %d %b\u2003%H:%M" --> "Fri Oct 31 13:00"
109+#. en_GB example: "%a %b %d\u2003%H:%M" --> "Fri 31 Oct 13:00"
110+#: plugins/Utils/relativetimeformatter.cpp:234
111+msgid "%a %d %b %H:%M"
112+msgstr ""
113+
34114#: qml/Components/DelayedLockscreen.qml:49
35115msgid "Device Locked"
36116msgstr ""
@@ -187,15 +267,15 @@ msgstr ""
187267msgid "Less..."
188268msgstr ""
189269
190−#: qml/Dash/Previews/PreviewRatingInput.qml:81
270+#: qml/Dash/Previews/PreviewRatingInput.qml:84
191271msgid "Rate this"
192272msgstr ""
193273
194−#: qml/Dash/Previews/PreviewRatingInput.qml:126
274+#: qml/Dash/Previews/PreviewRatingInput.qml:129
195275msgid "Add a review"
196276msgstr ""
197277
198−#: qml/Dash/Previews/PreviewRatingInput.qml:166
278+#: qml/Dash/Previews/PreviewRatingInput.qml:169
199279msgid "Send"
200280msgstr ""
201281
@@ -211,15 +291,15 @@ msgstr ""
211291msgid "Enable location data"
212292msgstr ""
213293
214−#: qml/Dash/ScopesList.qml:66
294+#: qml/Dash/ScopesList.qml:67
215295msgid "Manage"
216296msgstr ""
217297
218−#: qml/Dash/ScopesList.qml:112
298+#: qml/Dash/ScopesList.qml:113
219299msgid "Home"
220300msgstr ""
221301
222−#: qml/Dash/ScopesList.qml:113
302+#: qml/Dash/ScopesList.qml:114
223303msgid "Also installed"
224304msgstr ""
225305
@@ -305,27 +385,58 @@ msgstr ""
305385msgid "Nothing is playing"
306386msgstr ""
307387
308−#: qml/Panel/Indicators/MenuItemFactory.qml:787
388+#: qml/Panel/Indicators/MenuItemFactory.qml:768
389+#, qt-format
390+msgid "%1 hour"
391+msgid_plural "%1 hours"
392+msgstr[0] ""
393+msgstr[1] ""
394+
395+#: qml/Panel/Indicators/MenuItemFactory.qml:772
396+#, qt-format
397+msgid "%1 minute"
398+msgid_plural "%1 minutes"
399+msgstr[0] ""
400+msgstr[1] ""
401+
402+#: qml/Panel/Indicators/MenuItemFactory.qml:777
403+#, qt-format
404+msgid "%1 second"
405+msgid_plural "%1 seconds"
406+msgstr[0] ""
407+msgstr[1] ""
408+
409+#: qml/Panel/Indicators/MenuItemFactory.qml:780
410+msgid "0 seconds"
411+msgstr ""
412+
413+#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
414+#: qml/Panel/Indicators/MenuItemFactory.qml:782
415+#, qt-format
416+msgid "%1 remaining"
417+msgstr ""
418+
419+#: qml/Panel/Indicators/MenuItemFactory.qml:788
309420msgid "In queue…"
310421msgstr ""
311422
312−#: qml/Panel/Indicators/MenuItemFactory.qml:791
423+#: qml/Panel/Indicators/MenuItemFactory.qml:792
313424msgid "Downloading"
314425msgstr ""
315426
316−#: qml/Panel/Indicators/MenuItemFactory.qml:793
427+#: qml/Panel/Indicators/MenuItemFactory.qml:794
317428msgid "Paused, tap to resume"
318429msgstr ""
319430
320−#: qml/Panel/Indicators/MenuItemFactory.qml:795
431+#: qml/Panel/Indicators/MenuItemFactory.qml:796
321432msgid "Canceled"
322433msgstr ""
323434
324−#: qml/Panel/Indicators/MenuItemFactory.qml:797
435+#: qml/Panel/Indicators/MenuItemFactory.qml:798
325436msgid "Finished"
326437msgstr ""
327438
328−#: qml/Panel/Indicators/MenuItemFactory.qml:799
439+#: qml/Panel/Indicators/MenuItemFactory.qml:800
329440msgid "Failed, tap to retry"
330441msgstr ""
331442
@@ -404,6 +515,38 @@ msgctxt "Button: Go back one page in the Wizard"
404515msgid "Back"
405516msgstr ""
406517
518+#: qml/Wizard/Pages/here-terms.qml:27
519+msgid "Terms & Conditions"
520+msgstr ""
521+
522+#: qml/Wizard/Pages/passwd-confirm.qml:49
523+msgid "Confirm passphrase"
524+msgstr ""
525+
526+#: qml/Wizard/Pages/passwd-confirm.qml:50
527+msgid "Confirm passcode"
528+msgstr ""
529+
530+#: qml/Wizard/Pages/passwd-confirm.qml:53
531+#: qml/Wizard/Pages/passwd-confirm.qml:54
532+msgid "Please try again."
533+msgstr ""
534+
535+#: qml/Wizard/Pages/passwd-confirm.qml:82 qml/Wizard/Pages/passwd-set.qml:90
536+#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
537+#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
538+#: qml/Wizard/Pages/60-reporting.qml:50
539+msgid "Continue"
540+msgstr ""
541+
542+#: qml/Wizard/Pages/passwd-set.qml:61
543+msgid "Choose your passcode"
544+msgstr ""
545+
546+#: qml/Wizard/Pages/passwd-set.qml:68
547+msgid "Passphrase must be 4 characters long"
548+msgstr ""
549+
407550#: qml/Wizard/Pages/10-welcome.qml:27
408551msgid "Hi!"
409552msgstr ""
@@ -416,13 +559,6 @@ msgstr ""
416559msgid "Let’s get started."
417560msgstr ""
418561
419−#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
420−#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
421−#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
422−#: qml/Wizard/Pages/passwd-set.qml:90
423−msgid "Continue"
424−msgstr ""
425−
426562#: qml/Wizard/Pages/20-sim.qml:25
427563msgid "Add a SIM card and restart your device"
428564msgstr ""
@@ -501,7 +637,6 @@ msgstr ""
501637msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
502638msgstr ""
503639
504−#. TRANSLATORS: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
505640#: qml/Wizard/Pages/50-location.qml:103
506641msgid ""
507642"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
@@ -548,36 +683,13 @@ msgstr ""
548683msgid "Finish"
549684msgstr ""
550685
551−#: qml/Wizard/Pages/here-terms.qml:27
552−msgid "Terms & Conditions"
553−msgstr ""
554−
555−#: qml/Wizard/Pages/passwd-confirm.qml:49
556−msgid "Confirm passphrase"
557−msgstr ""
558−
559−#: qml/Wizard/Pages/passwd-confirm.qml:50
560−msgid "Confirm passcode"
561−msgstr ""
562−
563−#: qml/Wizard/Pages/passwd-confirm.qml:53
564−#: qml/Wizard/Pages/passwd-confirm.qml:54
565−msgid "Please try again."
566−msgstr ""
567−
568−#: qml/Wizard/Pages/passwd-set.qml:61
569−msgid "Choose your passcode"
570−msgstr ""
571−
572−#: qml/Wizard/Pages/passwd-set.qml:68
573−msgid "Passphrase must be 4 characters long"
574−msgstr ""
575−
686+#. Translators: This is the arrow for "Back" buttons
576687#: qml/Wizard/StackButton.qml:39
577688#, qt-format
578689msgid "〈 %1"
579690msgstr ""
580691
692+#. Translators: This is the arrow for "Forward" buttons
581693#: qml/Wizard/StackButton.qml:42
582694#, qt-format
583695msgid "%1 〉"
po/update-unity-pot+10−3
@@ -6,25 +6,32 @@ PO_DIR=$PWD
66PROGNAME=$(basename $0)
77
88# Create a list of files to scan
9−GETTEXT_FILES=$(mktemp --tmpdir uitk-unity.lst.XXXXX)
9+GETTEXT_FILES=$(mktemp --tmpdir unity8.lst.XXXXX)
1010trap 'rm -f "$GETTEXT_FILES"' EXIT
1111cd ..
1212find \( -name '*.h' -o -name '*.cpp' -o -name '*.qml' -o -name '*.js' \) \
13− -a ! \( -path './debian/*' -o -path './builddir/*' -o -path './build/*' -o -path './.bzr/*' \) | sort \
13+ -a ! \( -path './debian/*' -o -path './builddir/*' -o -path './build/*' -o -path './tests/*' -o -path './.bzr/*' \) | sort \
1414> $GETTEXT_FILES
1515
1616# Generate pot from our list
1717xgettext \
1818 --output $PO_DIR/unity8.pot \
19+ --from-code=UTF-8 \
1920 --files-from $GETTEXT_FILES \
2021 --qt --c++ \
2122 --add-comments=TRANSLATORS \
23+ --add-comments=Translators \
2224 --keyword=tr \
2325 --keyword=tr:1,2 \
2426 --keyword=dtr:2 \
27+ --keyword=dtr:2,3 \
2528 --keyword=ctr:1c,2 \
29+ --keyword=dctr:2c,3 \
30+ --keyword=tag \
31+ --keyword=tag:1c,2 \
32+ --keyword=dgettext_datetime \
2633 --package-name="unity8" \
2734 --copyright-holder="Canonical Ltd." \
2835 --from-code="UTF-8"
2936
30−echo "$PROGNAME: $PO_DIR/auto-generated.pot updated"
37+echo "$PROGNAME: $PO_DIR/unity8.pot updated"
qml/Panel/Indicators/MenuItemFactory.qml+7−6
@@ -102,7 +102,7 @@ Item {
102102 maximumValue: {
103103 var maximum = getExtendedProperty(extendedData, "maxValue", 1.0);
104104 if (maximum <= minimumValue) {
105− return minimumValue + 1;
105+ return minimumValue + 1;
106106 }
107107 return maximum;
108108 }
@@ -765,20 +765,21 @@ Item {
765765 var minutes = Math.floor(secondsLeft / 60) % 60;
766766 var seconds = secondsLeft % 60;
767767 if (hours > 0) {
768− remaining += hours + (hours == 1 ? " hour" : " hours");
768+ remaining += i18n.tr("%1 hour", "%1 hours", hours).arg(hours)
769769 }
770770 if (minutes > 0) {
771771 if (remaining != "") remaining += ", ";
772− remaining += minutes + (minutes == 1 ? " minute" : " minutes");
772+ remaining += i18n.tr("%1 minute", "%1 minutes", minutes).arg(minutes)
773773 }
774774 // don't include seconds if hours > 0
775775 if (hours == 0 && minutes < 5 && seconds > 0) {
776776 if (remaining != "") remaining += ", ";
777− remaining += seconds + (seconds == 1 ? " second" : " seconds");
777+ remaining += i18n.tr("%1 second", "%1 seconds", seconds).arg(seconds)
778778 }
779779 if (remaining == "")
780− remaining = "0 seconds";
781− return remaining + " remaining";
780+ remaining = i18n.tr("0 seconds");
781+ // Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
782+ return i18n.tr("%1 remaining").arg(remaining);
782783 }
783784
784785 stateText: {