Merge lp:~dpm/ubuntu-terminal-app/enable-translations into lp:ubuntu-terminal-app

Proposed by David Planella
Status: Work in progress
Proposed branch: lp:~dpm/ubuntu-terminal-app/enable-translations
Merge into: lp:ubuntu-terminal-app
Diff against target: 282 lines (+161/-36)
8 files modified
.bzrignore (+2/-0)
README.translations (+36/-0)
debian/changelog (+6/-0)
debian/control (+5/-4)
debian/rules (+9/-0)
po/po.pro (+42/-32)
po/ubuntu-terminal-app.pot (+50/-0)
ubuntu-terminal-app.qmlproject (+11/-0)
To merge this branch: bzr merge lp:~dpm/ubuntu-terminal-app/enable-translations
Reviewer Review Type Date Requested Status
Leo Arias (community) Needs Information
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+187986@code.launchpad.net

Commit message

Enable the translations infrastructure: expose translations in Launchpad and build/ship them in the Debian package.

Description of the change

Enable the translations infrastructure: expose translations in Launchpad and build/ship them in the Debian package.

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: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

David, this is no longer needed, right?

review: Needs Information

Unmerged revisions

27. By David Planella

Updated changelog, fixed a lintian warning

26. By David Planella

Added .pot file, added rule to build and ship translations

25. By David Planella

Changed the project file name for consistency and to get it to work with the translations script, updated the .pot template

24. By David Planella

Added initial translations infrastructure

23. By Nicholas Skaggs

Remove unused code, and finally fix circle menu test on device (thanks Omer!). Fixes: https://bugs.launchpad.net/bugs/1212262.

Approved by Ubuntu Phone Apps Jenkins Bot.

22. By Nicholas Skaggs

Fix valueselector (missed in previous merge)
Fix for circlemenu.

Approved by Ubuntu Phone Apps Jenkins Bot.

21. By Nicholas Skaggs

Change to polling instead of using assert, fix lambda silliness, and enable all tests.

Approved by Ubuntu Phone Apps Jenkins Bot.

20. By Nicholas Skaggs

This converts the terminal ap tests to the ubuntusdk emulator as well as cleans up and fixes all the tests; including the color scheme check. Fixes: https://bugs.launchpad.net/bugs/1188841.

Approved by Ubuntu Phone Apps Jenkins Bot.

19. By Nicholas Skaggs

This converts the terminal ap tests to the ubuntusdk emulator as well as cleans up and fixes all the tests; including the color scheme check. Fixes: https://bugs.launchpad.net/bugs/1188841.

Approved by Ubuntu Phone Apps Jenkins Bot.

18. By Michael Hall

Updated attribution in debian/copyright.

Approved by Dmitry Zagnoyko, Ubuntu Phone Apps Jenkins Bot.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2013-04-23 20:42:10 +0000
+++ .bzrignore 2013-09-27 06:58:57 +0000
@@ -4,3 +4,5 @@
4debian/ubuntu-terminal-app/4debian/ubuntu-terminal-app/
5debian/*.debhelper.log5debian/*.debhelper.log
6debian/*.substvars6debian/*.substvars
7.build
8po/Makefile
79
=== added file 'README.translations'
--- README.translations 1970-01-01 00:00:00 +0000
+++ README.translations 2013-09-27 06:58:57 +0000
@@ -0,0 +1,36 @@
1# Updating translations
2
3Translations for the Terminal app happen in [Launchpad Translations][] and
4are automatically committed daily on the trunk branch in the po/ folder.
5
6They are then built and installed as part of the package build, so that
7developers don't really need to worry about them.
8
9However, there is one task that needs to be taken care of: exposing new
10translatable messages to translators. So whenever you add new translatable
11messages in the code, make sure to follow these steps:
12
13 1. Change directory to the po/ folder: `cd po`
14 2. Update the translations template: `qmake && make pot`
15 3. Commit the generated .pot file: `bzr commit -m"Updated translation template"`
16 4. Push the branch and send a merge proposal as usual
17
18And that's it, once the branch lands Launchpad should take care of all the rest!
19
20# Behind the scenes
21
22Behind the scenes, whenever the po/*.pot file (also known as translations template)
23is committed to trunk Launchpad reads it and updates the translatable strings
24exposed in the web UI. This will enable translators to work on the new strings.
25The translations template contains all translatable strings that have been
26extracted from the source code files.
27
28Launchpad will then store translations in its database and will commit them daily
29in the form of textual po/*.po files to trunk. The PO files are also usually
30referred to as the translations files. You'll find a translation file for each
31language the app has got at least a translated message available for.
32
33Translations for core apps follow the standard [gettext format].
34
35 [Launchpad Translations]: https://translations.launchpad.net/ubuntu-terminal-app
36 [gettext format]: https://www.gnu.org/software/gettext/
037
=== modified file 'debian/changelog'
--- debian/changelog 2013-05-24 16:18:10 +0000
+++ debian/changelog 2013-09-27 06:58:57 +0000
@@ -1,3 +1,9 @@
1ubuntu-terminal-app (0.6) saucy; urgency=low
2
3 * Added translations infrastructure
4
5 -- David Planella <david.planella@ubuntu.com> Fri, 27 Sep 2013 08:49:50 +0200
6
1ubuntu-terminal-app (0.5) raring; urgency=low7ubuntu-terminal-app (0.5) raring; urgency=low
28
3 * Added landscape mode9 * Added landscape mode
410
=== modified file 'debian/control'
--- debian/control 2013-08-09 21:33:43 +0000
+++ debian/control 2013-09-27 06:58:57 +0000
@@ -10,12 +10,12 @@
10Package: ubuntu-terminal-app10Package: ubuntu-terminal-app
11Section: misc11Section: misc
12Architecture: all12Architecture: all
13Depends: ${misc:Depends},13Depends: qmlscene,
14 qmlscene,
15 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,14 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
16 qtdeclarative5-localstorage-plugin,15 qtdeclarative5-localstorage-plugin,
17 qtdeclarative5-qtquick2-plugin,16 qtdeclarative5-qtquick2-plugin,
18 qtdeclarative5-konsole-qml-plugin (>= 0.1.1)17 qtdeclarative5-konsole-qml-plugin (>= 0.1.1),
18 ${misc:Depends}
19Description: Terminal application19Description: Terminal application
20 Core Terminal application20 Core Terminal application
2121
@@ -24,6 +24,7 @@
24Depends: libautopilot-qt,24Depends: libautopilot-qt,
25 libqt5test5,25 libqt5test5,
26 ubuntu-ui-toolkit-autopilot,26 ubuntu-ui-toolkit-autopilot,
27 ubuntu-terminal-app (= ${source:Version})27 ubuntu-terminal-app (= ${source:Version}),
28 ${misc:Depends}
28Description: Autopilot tests for Terminal Application29Description: Autopilot tests for Terminal Application
29 This package contains the autopilot tests for the Terminal30 This package contains the autopilot tests for the Terminal
3031
=== modified file 'debian/rules'
--- debian/rules 2013-04-11 21:26:07 +0000
+++ debian/rules 2013-09-27 06:58:57 +0000
@@ -9,3 +9,12 @@
99
10override_dh_install:10override_dh_install:
11 dh_install --fail-missing11 dh_install --fail-missing
12 appname=ubuntu-terminal-app; \
13 for pofile in $(shell find ./po -name "*.po"); do \
14 pofilename="$${pofile##*/}"; \
15 langcode="$${pofilename%.*}"; \
16 localedir="debian/$$appname/usr/share/locale/$$langcode/LC_MESSAGES"; \
17 mkdir -p $$localedir; \
18 mofile="$$localedir/$$appname.mo"; \
19 msgfmt -o $$mofile $$pofile; \
20 done
1221
=== modified file 'po/po.pro'
--- po/po.pro 2013-02-12 16:18:48 +0000
+++ po/po.pro 2013-09-27 06:58:57 +0000
@@ -1,48 +1,58 @@
1## This .pro file is used to create a Makefile with the necessary rules
2## to create an initial translations template and to update it whenever
3## there are new translatable strings in the project that are ready to be
4## exposed to translators
5##
6## See the ../README.translations file for more information
7
1TEMPLATE = subdirs8TEMPLATE = subdirs
29
3PROJECTNAME = $$system(basename ../*.qmlproject)10PROJECTNAME = $$system(basename ../*.qmlproject)
4PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)11PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)
512
6SOURCECODE = ../*.qml13DESKTOPFILE = ../$${PROJECTNAME}.desktop
14
15SOURCECODE = ../*.qml \
16 ../config/*.qml \
17 ../extraPanel/*.qml
18
19BUILDDIR = ../.build
20DESKTOPFILETEMP = $${BUILDDIR}/$${PROJECTNAME}.desktop.js
721
8message("")22message("")
9message(" Project Name: $$PROJECTNAME ")23message(" Project Name: $$PROJECTNAME ")
10message(" Source Code: $$SOURCECODE ")24message(" Source Code: $$SOURCECODE ")
11message("")25message("")
12message(" run 'make pot' to generate the pot file from source code. ")26message(" 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("")27message("")
1728
18## generate pot file 'make pot'29## Generate pot file 'make pot'
19potfile.target = pot30potfile.target = pot
20potfile.commands = xgettext -o $${PROJECTNAME}.pot --package-name $${PROJECTNAME} --qt --c++ --add-comments=TRANSLATORS --keyword=tr $${SOURCECODE}31potfile.commands = xgettext \
32 -o $${PROJECTNAME}.pot \
33 --copyright=\"Canonical Ltd. \" \
34 --package-name $${PROJECTNAME} \
35 --qt --c++ --add-comments=TRANSLATORS \
36 --keyword=tr --keyword=tr:1,2 \
37 $${SOURCECODE} $${DESKTOPFILETEMP}
38potfile.depends = desktopfile
21QMAKE_EXTRA_TARGETS += potfile39QMAKE_EXTRA_TARGETS += potfile
2240
23## poedit target for new translations 'make translate'41## Do not use this rule directly. It's a dependency rule to
24poedit.target = translate42## generate an intermediate .js file to extract translatable
25poedit.commands = cp messages.pot new_language.po; poedit new_language.po43## strings from the .desktop file
26QMAKE_EXTRA_TARGETS += poedit44desktopfile.target = desktopfile
2745desktopfile.commands = awk \'BEGIN { FS=\"=\" }; /Name/ {print \"var s = i18n.tr(\42\" \$$2 \"\42);\"}\' $${DESKTOPFILE} > $${DESKTOPFILETEMP}
28## generate mo files 'make mo'46desktopfile.depends = makebuilddir
29mofiles.target = mo47QMAKE_EXTRA_TARGETS += desktopfile
30mofiles.commands = msgfmt *.po48
31QMAKE_EXTRA_TARGETS += mofiles49## Dependency rule to create the temporary build dir
3250makebuilddir.target = makebuilddir
33## Installation steps for mo files. 'make install'51makebuilddir.commands = mkdir -p $${BUILDDIR}
34MO_FILES = $$system(ls *.mo)52QMAKE_EXTRA_TARGETS += makebuilddir
3553
36install_mo_commands =54## Rule to clean the products of the build
37for(mo_file, MO_FILES) {55clean.target = clean
38 mo_name = $$replace(mo_file,.mo,)56clean.commands = rm -Rf $${BUILDDIR}
39 mo_targetpath = $(INSTALL_ROOT)/usr/share/locale/$${mo_name}/LC_MESSAGES57QMAKE_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
4858
4959
=== added file 'po/ubuntu-terminal-app.pot'
--- po/ubuntu-terminal-app.pot 1970-01-01 00:00:00 +0000
+++ po/ubuntu-terminal-app.pot 2013-09-27 06:58:57 +0000
@@ -0,0 +1,50 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR Canonical Ltd.
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: ubuntu-terminal-app\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-09-27 08:41+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"
16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"
19
20#: ../Configs.qml:46
21msgid "Color scheme"
22msgstr ""
23
24#: ../Configs.qml:60
25msgid "Font size"
26msgstr ""
27
28#: ../ubuntu-terminal-app.qml:24
29msgid "Control keys"
30msgstr ""
31
32#: ../ubuntu-terminal-app.qml:29
33msgid "Function keys"
34msgstr ""
35
36#: ../ubuntu-terminal-app.qml:34
37msgid "Text ctrl keys"
38msgstr ""
39
40#: ../ubuntu-terminal-app.qml:39
41msgid "Hide extra panel"
42msgstr ""
43
44#: ../ubuntu-terminal-app.qml:53 ../.build/ubuntu-terminal-app.desktop.js:1
45msgid "Terminal"
46msgstr ""
47
48#: ../ubuntu-terminal-app.qml:87
49msgid "Settings"
50msgstr ""
051
=== renamed file 'terminal.qmlproject' => 'ubuntu-terminal-app.qmlproject'
--- terminal.qmlproject 2013-04-30 20:53:03 +0000
+++ ubuntu-terminal-app.qmlproject 2013-09-27 06:58:57 +0000
@@ -15,6 +15,17 @@
15 ImageFiles {15 ImageFiles {
16 directory: "."16 directory: "."
17 }17 }
18 /* Shows the README files in the project view */
19 Files {
20 filter: "README*"
21 }
22 /* Shows the translation files and the .pro file used to generate the .pot template */
23 Files {
24 filter: "*.po*"
25 }
26 Files {
27 filter: "*.pro"
28 }
18 /* List of plugin directories passed to QML runtime */29 /* List of plugin directories passed to QML runtime */
19 importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]30 importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]
20}31}

Subscribers

People subscribed via source and target branches