Merge lp:~dpm/ubuntu-calendar-app/desktop-file-i18n into lp:ubuntu-calendar-app

Proposed by David Planella
Status: Merged
Approved by: David Planella
Approved revision: 42
Merged at revision: 51
Proposed branch: lp:~dpm/ubuntu-calendar-app/desktop-file-i18n
Merge into: lp:ubuntu-calendar-app
Prerequisite: lp:~dpm/ubuntu-calendar-app/rename
Diff against target: 250 lines (+101/-73)
4 files modified
.bzrignore (+2/-0)
README (+20/-0)
po/calendar-app.pot (+45/-41)
po/po.pro (+34/-32)
To merge this branch: bzr merge lp:~dpm/ubuntu-calendar-app/desktop-file-i18n
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
David Planella Approve
Olivier Tilloy (community) Approve
Review via email: mp+169029@code.launchpad.net

Commit message

Added support for extracting translatable strings from the .desktop files

Description of the change

Added support for extracting translatable strings from the .desktop files

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good to me. As agreed on IRC, please add an entry to the README file to explain how to generate an up-to-date translation template, and then feel free to top-approve.

review: Approve
Revision history for this message
David Planella (dpm) wrote :

Ok, updated README file as requested, and top-approving. Thanks!

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Approved to make Jenkins happy

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2013-06-12 18:12:18 +0000
+++ .bzrignore 2013-06-17 17:32:28 +0000
@@ -4,3 +4,5 @@
4debian/app-template/4debian/app-template/
5debian/*.debhelper.log5debian/*.debhelper.log
6debian/*.substvars6debian/*.substvars
7.build
8po/Makefile
79
=== modified file 'README'
--- README 2013-03-14 11:38:17 +0000
+++ README 2013-06-17 17:32:28 +0000
@@ -7,3 +7,23 @@
7$ qmlscene calendar.qml7$ qmlscene calendar.qml
88
9To test the application on the device check out the "testrun.sh" script.9To test the application on the device check out the "testrun.sh" script.
10
11# Updating translations
12
13Translations for the Calendar app happen in [Launchpad Translations][] and
14are automatically committed daily on the trunk branch in the po/ folder.
15
16They are then built and installed as part of the package build, so that
17developers don't really need to worry about them.
18
19However, there is one task that needs to be taken care of: exposing new
20translatable messages to translators. So whenever you add new translatable
21messages in the code, make sure to follow these steps:
22
23 1. Change directory to the po/ folder: `cd po`
24 2. Update the translations template: `qmake && make pot`
25 3. Commit the generated .pot file: `bzr commit -m"Updated translation template"`
26
27And that's it, Launchpad should take care of all the rest
28
29 [Launchpad Translations]: https://translations.launchpad.net/ubuntu-calendar-app
1030
=== modified file 'po/calendar-app.pot'
--- po/calendar-app.pot 2013-06-12 18:12:18 +0000
+++ po/calendar-app.pot 2013-06-17 17:32:28 +0000
@@ -1,14 +1,14 @@
1# SOME DESCRIPTIVE TITLE.1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER2# Copyright (C) YEAR Canonical Ltd.
3# This file is distributed under the same license as the PACKAGE package.3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#5#
6#, fuzzy6#, fuzzy
7msgid ""7msgid ""
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-calendar-app\n"9"Project-Id-Version: calendar-app\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-05-23 23:02+0900\n"11"POT-Creation-Date: 2013-06-12 17:24+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,64 +17,68 @@
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: DiaryView.qml:5420#: ../DiaryView.qml:54
21msgid "(+) New Event"21msgid "(+) New Event"
22msgstr ""22msgstr ""
2323
24#: NewEvent.qml:10424#: ../EventDetails.qml:69
25msgid "Add Location"
26msgstr ""
27
28#: NewEvent.qml:25
29msgid "Add event name"
30msgstr ""
31
32#: EventDetails.qml:69
33msgid "Add invite"25msgid "Add invite"
34msgstr ""26msgstr ""
3527
36#: NewEvent.qml:2028#: ../EventDetails.qml:75
29msgid "Edit"
30msgstr ""
31
32#: ../EventDetails.qml:150 ../NewEvent.qml:112
33msgid "People"
34msgstr ""
35
36#: ../NewEvent.qml:20
37msgid "Create event"37msgid "Create event"
38msgstr ""38msgstr ""
3939
40#: calendar.qml:4540#: ../NewEvent.qml:25
41msgid "Diary"41msgid "Add event name"
42msgstr ""42msgstr ""
4343
44#: EventDetails.qml:7544#: ../NewEvent.qml:99
45msgid "Edit"45msgid "Location"
46msgstr ""
47
48#: ../NewEvent.qml:104
49msgid "Add Location"
50msgstr ""
51
52#: ../NewEvent.qml:117
53msgid "Invite People"
54msgstr ""
55
56#: ../NewEvent.qml:128
57msgid "Save"
46msgstr ""58msgstr ""
4759
48#. TRANSLATORS: this is a time formatting string,60#. TRANSLATORS: this is a time formatting string,
49#. see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions61#. see http://qt-project.org/doc/qt-5.0/qtqml/qml-qtquick2-date.html#details for valid expressions
50#: TimeLineView.qml:14762#: ../TimeLineView.qml:147
51msgid "HH:mm"63msgid "HH:mm"
52msgstr ""64msgstr ""
5365
54#: NewEvent.qml:11766#: ../calendar.qml:31
55msgid "Invite People"67msgid "To-do"
56msgstr ""68msgstr ""
5769
58#: NewEvent.qml:9970#: ../calendar.qml:36
59msgid "Location"
60msgstr ""
61
62#: calendar.qml:36
63msgid "New Event"71msgid "New Event"
64msgstr ""72msgstr ""
6573
66#: EventDetails.qml:150 NewEvent.qml:11274#: ../calendar.qml:41 ../calendar.qml:48
67msgid "People"
68msgstr ""
69
70#: NewEvent.qml:128
71msgid "Save"
72msgstr ""
73
74#: calendar.qml:41 calendar.qml:48
75msgid "Timeline"75msgid "Timeline"
76msgstr ""76msgstr ""
7777
78#: calendar.qml:3178#: ../calendar.qml:45
79msgid "To-do"79msgid "Diary"
80msgstr ""
81
82#: ../.build/calendar-app.desktop.js:1
83msgid "Calendar"
80msgstr ""84msgstr ""
8185
=== modified file 'po/po.pro'
--- po/po.pro 2013-06-12 18:12:18 +0000
+++ po/po.pro 2013-06-17 17:32:28 +0000
@@ -3,46 +3,48 @@
3PROJECTNAME = $$system(basename ../*.qmlproject)3PROJECTNAME = $$system(basename ../*.qmlproject)
4PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)4PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)
55
6SOURCECODE = ../*.qml6DESKTOPFILE = ../$${PROJECTNAME}.desktop
7
8SOURCECODE = ../*.qml \
9 ../*.js
10
11BUILDDIR = ../.build
12DESKTOPFILETEMP = $${BUILDDIR}/$${PROJECTNAME}.desktop.js
713
8message("")14message("")
9message(" Project Name: $$PROJECTNAME ")15message(" Project Name: $$PROJECTNAME ")
10message(" Source Code: $$SOURCECODE ")16message(" Source Code: $$SOURCECODE ")
11message("")17message("")
12message(" run 'make pot' to generate the pot file from source code. ")18message(" Run 'make pot' to generate the pot file from source code. ")
13message(" run 'make translate' to create a new translation (po) based on pot. ")
14message(" run 'make mo' to generate the mo files from po files. ")
15message(" run 'qmake; make install' to install the mo files. ")
16message("")19message("")
1720
18## generate pot file 'make pot'21## Generate pot file 'make pot'
19potfile.target = pot22potfile.target = pot
20potfile.commands = xgettext -o $${PROJECTNAME}.pot --package-name $${PROJECTNAME} --qt --c++ --add-comments=TRANSLATORS --keyword=tr $${SOURCECODE}23potfile.commands = xgettext \
24 -o $${PROJECTNAME}.pot \
25 --copyright=\"Canonical Ltd.\" \
26 --package-name $${PROJECTNAME} \
27 --qt --c++ --add-comments=TRANSLATORS \
28 --keyword=tr --keyword=tr:1,2 \
29 $${SOURCECODE} $${DESKTOPFILETEMP}
30potfile.depends = desktopfile
21QMAKE_EXTRA_TARGETS += potfile31QMAKE_EXTRA_TARGETS += potfile
2232
23## poedit target for new translations 'make translate'33## Do not use this rule directly. It's a dependency rule to
24poedit.target = translate34## generate an intermediate .h file to extract translatable
25poedit.commands = cp messages.pot new_language.po; poedit new_language.po35## strings from the .desktop file
26QMAKE_EXTRA_TARGETS += poedit36desktopfile.target = desktopfile
2737desktopfile.commands = awk \'BEGIN { FS=\"=\" }; /Name/ {print \"var s = i18n.tr(\42\" \$$2 \"\42);\"}\' $${DESKTOPFILE} > $${DESKTOPFILETEMP}
28## generate mo files 'make mo'38desktopfile.depends = makebuilddir
29mofiles.target = mo39QMAKE_EXTRA_TARGETS += desktopfile
30mofiles.commands = msgfmt *.po40
31QMAKE_EXTRA_TARGETS += mofiles41## Dependency rule to create the temporary build dir
3242makebuilddir.target = makebuilddir
33## Installation steps for mo files. 'make install'43makebuilddir.commands = mkdir -p $${BUILDDIR}
34MO_FILES = $$system(ls *.mo)44QMAKE_EXTRA_TARGETS += makebuilddir
3545
36install_mo_commands =46## Rule to clean the products of the build
37for(mo_file, MO_FILES) {47clean.target = clean
38 mo_name = $$replace(mo_file,.mo,)48clean.commands = rm -Rf $${BUILDDIR}
39 mo_targetpath = $(INSTALL_ROOT)/usr/share/locale/$${mo_name}/LC_MESSAGES49QMAKE_EXTRA_TARGETS += clean
40 mo_target = $${mo_targetpath}/$${PROJECTNAME}.mo
41 !isEmpty(install_mo_commands): install_mo_commands += &&
42 install_mo_commands += test -d $$mo_targetpath || mkdir -p $$mo_targetpath
43 install_mo_commands += && cp $$mo_file $$mo_target
44}
45
46install.commands = $$install_mo_commands
47QMAKE_EXTRA_TARGETS += install
4850

Subscribers

People subscribed via source and target branches

to status/vote changes: