Merge lp:~dpm/ubuntu-weather-app/desktop-file-i18n into lp:ubuntu-weather-app/obsolete.trunk

Proposed by David Planella
Status: Merged
Approved by: Martin Borho
Approved revision: 34
Merged at revision: 32
Proposed branch: lp:~dpm/ubuntu-weather-app/desktop-file-i18n
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 155 lines (+48/-40)
3 files modified
po/po.pro (+35/-28)
po/ubuntu-weather-app.pot (+12/-12)
ubuntu-weather-app.desktop (+1/-0)
To merge this branch: bzr merge lp:~dpm/ubuntu-weather-app/desktop-file-i18n
Reviewer Review Type Date Requested Status
Martin Borho Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+168946@code.launchpad.net

Commit message

Updated the qmake file to extract translatable strings from the .desktop file and include them in the generated .pot file.

Description of the change

Updated the qmake file to extract translatable strings from the .desktop file and include them in the generated .pot file.

Up until now, the .desktop file contents and thus the name of the app in the dash was not translatable.

To post a comment you must log in.
33. By David Planella

Internationalized desktop file

34. By David Planella

Changed the intermediate .h file to .js, which seems more appropriate for the SDK, and does not require an extra gettext keyword

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
Martin Borho (martin-borho) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/po.pro'
--- po/po.pro 2013-05-28 12:26:03 +0000
+++ po/po.pro 2013-06-12 13:56:30 +0000
@@ -3,42 +3,49 @@
3PROJECTNAME = $$system(basename ../*.qmlproject)3PROJECTNAME = $$system(basename ../*.qmlproject)
4PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)4PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)
55
6SOURCECODE = ../*.qml6DESKTOPFILE = ../$${PROJECTNAME}.desktop
7SOURCECODE += ../components/*.qml7
8SOURCECODE += ../components/*.js8SOURCECODE = ../*.qml \
9 ../components/*.qml \
10 ../components/*.js
11
12BUILDDIR = ../.build
13DESKTOPFILETEMP = $${BUILDDIR}/$${PROJECTNAME}.desktop.js
914
10message("")15message("")
11message(" Project Name: $$PROJECTNAME ")16message(" Project Name: $$PROJECTNAME ")
12message(" Source Code: $$SOURCECODE ")17message(" Source Code: $$SOURCECODE ")
13message("")18message("")
14message(" run 'make pot' to generate the pot file from source code. ")19message(" Run 'make pot' to generate the pot file from source code. ")
15message(" run 'make mo' to generate the mo files from po files. ")
16message(" run 'qmake; make install' to install the mo files. ")
17message("")20message("")
1821
19## generate pot file 'make pot'22## Generate pot file 'make pot'
20potfile.target = pot23potfile.target = pot
21potfile.commands = xgettext -o $${PROJECTNAME}.pot --copyright=\"Canonical Ltd. \" --package-name $${PROJECTNAME} --qt --c++ --add-comments=TRANSLATORS --keyword=tr --keyword=tr:1,2 $${SOURCECODE}24potfile.commands = xgettext \
25 -o $${PROJECTNAME}.pot \
26 --copyright=\"Canonical Ltd. \" \
27 --package-name $${PROJECTNAME} \
28 --qt --c++ --add-comments=TRANSLATORS \
29 --keyword=tr --keyword=tr:1,2 \
30 $${SOURCECODE} $${DESKTOPFILETEMP}
31potfile.depends = desktopfile
22QMAKE_EXTRA_TARGETS += potfile32QMAKE_EXTRA_TARGETS += potfile
2333
24## generate mo files 'make mo'34## Do not use this rule directly. It's a dependency rule to
25mofiles.target = mo35## generate an intermediate .h file to extract translatable
26mofiles.commands = msgfmt *.po36## strings from the .desktop file
27QMAKE_EXTRA_TARGETS += mofiles37desktopfile.target = desktopfile
2838desktopfile.commands = awk \'BEGIN { FS=\"=\" }; /Name/ {print \"var s = i18n.tr(\42\" \$$2 \"\42);\"}\' $${DESKTOPFILE} > $${DESKTOPFILETEMP}
29## Installation steps for mo files. 'make install'39desktopfile.depends = makebuilddir
30MO_FILES = $$system(ls *.mo)40QMAKE_EXTRA_TARGETS += desktopfile
3141
32install_mo_commands =42## Dependency rule to create the temporary build dir
33for(mo_file, MO_FILES) {43makebuilddir.target = makebuilddir
34 mo_name = $$replace(mo_file,.mo,)44makebuilddir.commands = mkdir -p $${BUILDDIR}
35 mo_targetpath = $(INSTALL_ROOT)/usr/share/locale/$${mo_name}/LC_MESSAGES45QMAKE_EXTRA_TARGETS += makebuilddir
36 mo_target = $${mo_targetpath}/$${PROJECTNAME}.mo46
37 !isEmpty(install_mo_commands): install_mo_commands += &&47## Rule to clean the products of the build
38 install_mo_commands += test -d $$mo_targetpath || mkdir -p $$mo_targetpath48clean.target = clean
39 install_mo_commands += && cp $$mo_file $$mo_target49clean.commands = rm -Rf $${BUILDDIR}
40}50QMAKE_EXTRA_TARGETS += clean
41
42install.commands = $$install_mo_commands
43QMAKE_EXTRA_TARGETS += install
4451
4552
=== modified file 'po/ubuntu-weather-app.pot'
--- po/ubuntu-weather-app.pot 2013-05-28 12:26:03 +0000
+++ po/ubuntu-weather-app.pot 2013-06-12 13:56:30 +0000
@@ -1,6 +1,6 @@
1# Ubuntu Touch Weather app translations1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) 2013 Canonical Ltd. 2# Copyright (C) YEAR Canonical Ltd.
3# This file is distributed under the same license as the ubuntu-weather-app 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
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-weather-app\n"9"Project-Id-Version: ubuntu-weather-app\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-05-28 14:18+0200\n"11"POT-Creation-Date: 2013-06-12 15:54+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"
@@ -22,18 +22,18 @@
22msgstr ""22msgstr ""
2323
24#: ../components/AddLocationDialog.qml:1424#: ../components/AddLocationDialog.qml:14
25msgid "Write a city name o pick it by your location"25msgid "Write a city name or pick it by your location"
26msgstr ""26msgstr ""
2727
28#: ../components/AddLocationDialog.qml:4228#: ../components/AddLocationDialog.qml:43
29msgid "Enter a city name"29msgid "Enter a city name"
30msgstr ""30msgstr ""
3131
32#: ../components/AddLocationDialog.qml:6232#: ../components/AddLocationDialog.qml:63
33msgid "Use my own location"33msgid "Use my own location"
34msgstr ""34msgstr ""
3535
36#: ../components/AddLocationDialog.qml:7436#: ../components/AddLocationDialog.qml:75
37msgid "Cancel"37msgid "Cancel"
38msgstr ""38msgstr ""
3939
@@ -46,10 +46,6 @@
46msgid "Min."46msgid "Min."
47msgstr ""47msgstr ""
4848
49#: ../components/LoadingComponent.qml:29
50msgid "Loading"
51msgstr ""
52
53#: ../components/LocationTab.qml:64 ../components/LocationTabEmpty.qml:2049#: ../components/LocationTab.qml:64 ../components/LocationTabEmpty.qml:20
54msgid "Add"50msgid "Add"
55msgstr ""51msgstr ""
@@ -65,3 +61,7 @@
65#: ../components/LocationTabEmpty.qml:861#: ../components/LocationTabEmpty.qml:8
66msgid "No Locations"62msgid "No Locations"
67msgstr ""63msgstr ""
64
65#: ../.build/ubuntu-weather-app.desktop.js:1
66msgid "Weather"
67msgstr ""
6868
=== modified file 'ubuntu-weather-app.desktop'
--- ubuntu-weather-app.desktop 2013-04-11 20:37:30 +0000
+++ ubuntu-weather-app.desktop 2013-06-12 13:56:30 +0000
@@ -8,3 +8,4 @@
8Name=Weather8Name=Weather
9X-Ubuntu-Touch=true9X-Ubuntu-Touch=true
10X-Ubuntu-StageHint=SideStage10X-Ubuntu-StageHint=SideStage
11X-Ubuntu-Gettext-Domain=ubuntu-weather-app

Subscribers

People subscribed via source and target branches