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
6
## See the ../README.translations file for more information
10
PROJECTNAME = $$system(basename ../*.qmlproject)
11
PROJECTNAME = $$replace(PROJECTNAME,.qmlproject,)
13
DESKTOPFILE = ../com.ubuntu.music_music.desktop.in
15
SOURCECODE = ../*.qml \
20
DESKTOPFILETEMP = $${BUILDDIR}/com.ubuntu.music_music.desktop.in
23
message(" Project Name: $$PROJECTNAME ")
24
message(" Source Code: $$SOURCECODE ")
26
message(" Run 'make pot' to generate the pot file from source code. ")
29
## Generate pot file 'make pot'
31
potfile.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}
38
potfile.depends = desktopfile
39
QMAKE_EXTRA_TARGETS += potfile
41
## Do not use this rule directly. It's a dependency rule to
42
## generate an intermediate .js file to extract translatable
43
## strings from the .desktop file
44
desktopfile.target = desktopfile
45
desktopfile.commands = awk \'BEGIN { FS=\"=\" }; /Name/ {print \"var s = i18n.tr(\42\" \$$2 \"\42);\"}\' $${DESKTOPFILE} > $${DESKTOPFILETEMP}
46
desktopfile.depends = makebuilddir
47
QMAKE_EXTRA_TARGETS += desktopfile
49
## Dependency rule to create the temporary build dir
50
makebuilddir.target = makebuilddir
51
makebuilddir.commands = mkdir -p $${BUILDDIR}
52
QMAKE_EXTRA_TARGETS += makebuilddir
54
## Rule to clean the products of the build
56
clean.commands = rm -Rf $${BUILDDIR}
57
QMAKE_EXTRA_TARGETS += clean