Merge lp:~dobey/ubuntu-printing-app/fix-i18n into lp:ubuntu-printing-app

Proposed by dobey
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 50
Merged at revision: 33
Proposed branch: lp:~dobey/ubuntu-printing-app/fix-i18n
Merge into: lp:ubuntu-printing-app
Prerequisite: lp:~dobey/ubuntu-printing-app/add-notifier-daemon
Diff against target: 370 lines (+144/-117)
4 files modified
CMakeLists.txt (+1/-11)
po/CMakeLists.txt (+13/-44)
po/ubuntu-printing-app.pot (+125/-58)
ubuntu-printing-app/CMakeLists.txt (+5/-4)
To merge this branch: bzr merge lp:~dobey/ubuntu-printing-app/fix-i18n
Reviewer Review Type Date Requested Status
Andrew Hayzen (community) Approve
Review via email: mp+320263@code.launchpad.net

Commit message

Use intltool module from cmake-extras and update template.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Should this run when doing a build? I haven't yet been able to get the .pot to be regenerated when doing a build? I was expecting it todo this.

review: Needs Information
Revision history for this message
dobey (dobey) wrote :

No. Regenerating the .pot file with every build will create lots of needless changes to the file when strings aren't changed, and will create situations with conflicts when multiple people are working on different branches. The file should only be updated when strings are added or removed, generally. "make ubuntu-printing-app.pog" will cause it get rebuilt.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

OK thanks, this works nicely in that case :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-03-17 21:17:09 +0000
+++ CMakeLists.txt 2017-03-17 21:17:09 +0000
@@ -5,15 +5,7 @@
5enable_testing()5enable_testing()
66
7# Load translation tools7# Load translation tools
8find_program(INTLTOOL_MERGE intltool-merge)8find_package(Intltool REQUIRED)
9if(NOT INTLTOOL_MERGE)
10 message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
11endif()
12
13find_program(INTLTOOL_EXTRACT intltool-extract)
14if(NOT INTLTOOL_EXTRACT)
15 message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
16endif()
179
18# Set the vars10# Set the vars
19set(APP_NAME ubuntu-printing-app)11set(APP_NAME ubuntu-printing-app)
@@ -60,8 +52,6 @@
6052
61# Setup gettext defs and include po directory53# Setup gettext defs and include po directory
62set(GETTEXT_PACKAGE "ubuntu-printing-app")54set(GETTEXT_PACKAGE "ubuntu-printing-app")
63add_definitions(-DI18N_DOMAIN="${GETTEXT_PACKAGE}")
64
65add_subdirectory(po)55add_subdirectory(po)
6656
67# Add tests57# Add tests
6858
=== modified file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 2017-01-24 10:58:19 +0000
+++ po/CMakeLists.txt 2017-03-17 21:17:09 +0000
@@ -1,44 +1,13 @@
1project(ubuntu-printing-app-translations)1
22intltool_update_potfile(
3include(FindGettext)3 KEYWORDS "_" "_:1,2" "N_" "N_:1,2" "tr" "tr:1,2"
4find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)4 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
55 COPYRIGHT_HOLDER "Canonical Ltd."
6file(RELATIVE_PATH DESKTOP_FILE_IN_IN ${CMAKE_SOURCE_DIR}6 FILE_GLOBS "${CMAKE_SOURCE_DIR}/*.desktop.in.in" "${CMAKE_SOURCE_DIR}/*.qml"
7 ${CMAKE_SOURCE_DIR}/ubuntu-printing-app/${DESKTOP_FILE}.in.in)7 FILTER "tests/*"
8file(RELATIVE_PATH DESKTOP_FILE_IN_IN_H ${CMAKE_SOURCE_DIR}8)
9 ${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_FILE_IN_IN}.h)9
1010intltool_install_translations(
11file(GLOB_RECURSE I18N_SRC_FILES11 ALL
12 RELATIVE ${CMAKE_SOURCE_DIR}12 GETTEXT_PACKAGE ${GETTEXT_PACKAGE}
13 ${CMAKE_SOURCE_DIR}/ubuntu-printing-app/**.qml)13)
14list(SORT I18N_SRC_FILES)
15
16set(DOMAIN ${GETTEXT_PACKAGE})
17set(POT_FILE ${DOMAIN}.pot)
18file(GLOB PO_FILES *.po)
19
20add_custom_target(${POT_FILE} ALL
21 COMMENT "Generating translation template"
22 COMMAND touch ${POT_FILE}
23 COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
24 --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_IN_IN}
25 COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
26 -D ${CMAKE_SOURCE_DIR}
27 --from-code=UTF-8
28 --c++ --qt --add-comments=TRANSLATORS
29 --keyword=tr --keyword=tr:1,2 --keyword=N_
30 -j
31 --package-name=ubuntu-printing-app
32 --copyright-holder='Canonical Ltd.'
33 -D ${CMAKE_SOURCE_DIR} ${I18N_SRC_FILES}
34 -D ${CMAKE_BINARY_DIR} ${DESKTOP_FILE_IN_IN_H}
35 COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
36
37foreach(PO_FILE ${PO_FILES})
38 get_filename_component(LANG ${PO_FILE} NAME_WE)
39 gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
40 set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
41 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
42 DESTINATION ${INSTALL_DIR}
43 RENAME ${DOMAIN}.mo)
44endforeach(PO_FILE)
4514
=== modified file 'po/ubuntu-printing-app.pot'
--- po/ubuntu-printing-app.pot 2017-02-28 15:34:29 +0000
+++ po/ubuntu-printing-app.pot 2017-03-17 21:17:09 +0000
@@ -1,129 +1,196 @@
1# SOME DESCRIPTIVE TITLE.1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR Canonical Ltd.2# Copyright (C) YEAR Canonical Ltd.
3# This file is distributed under the same license as the ubuntu-printing-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
7msgid ""7msgid ""
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-printing-app\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2017-02-28 15:29+0000\n"11"POT-Creation-Date: 2017-03-17 17:00-0400\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"
15"Language: \n"15"Language: \n"
16"MIME-Version: 1.0\n"16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=UTF-8\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20#: ubuntu-printing-app/Main.qml:6620
21#: ../notifier/src/notify-engine.cpp:48
22#, c-format
23msgid "A cover is open on the printer “%s”."
24msgstr ""
25
26#: ../notifier/src/notify-engine.cpp:49
27#, c-format
28msgid "The printer “%s” can’t be used, because required software is missing."
29msgstr ""
30
31#: ../notifier/src/notify-engine.cpp:50
32#, c-format
33msgid "A door is open on the printer “%s”."
34msgstr ""
35
36#: ../notifier/src/notify-engine.cpp:51
37#, c-format
38msgid "The printer “%s” is out of paper."
39msgstr ""
40
41#: ../notifier/src/notify-engine.cpp:52
42#, c-format
43msgid "The printer “%s” is low on paper."
44msgstr ""
45
46#: ../notifier/src/notify-engine.cpp:53
47#, c-format
48msgid "The printer “%s” is currently off-line."
49msgstr ""
50
51#: ../notifier/src/notify-engine.cpp:54
52#, c-format
53msgid "The printer “%s” has an unknown problem."
54msgstr ""
55
56#: ../notifier/src/notify-engine.cpp:55
57#, c-format
58msgid "The printer “%s” is out of toner."
59msgstr ""
60
61#: ../notifier/src/notify-engine.cpp:56
62#, c-format
63msgid "The printer “%s” is low on toner."
64msgstr ""
65
66#: ../notifier/src/notify-engine.cpp:167
67#, c-format
68msgid "“%s” has printed."
69msgstr ""
70
71#: ../notifier/src/notify-engine.cpp:185
72#, c-format
73msgid "You have %d job queued to print on this printer."
74msgid_plural "You have %d jobs queued to print on this printer."
75msgstr[0] ""
76msgstr[1] ""
77
78#: ../notifier/src/notify-engine.cpp:193
79#: ../ubuntu-printing-app/components/AlertDialog.qml:28
80msgid "OK"
81msgstr ""
82
83#: ../notifier/src/notify-engine.cpp:195
84msgid "Settings…"
85msgstr ""
86
87#. notifier
88#. printing
89#. ubuntu
90#: ../ubuntu-printing-app/ubuntu-printing-app.desktop.in.in.h:1
91#: ../ubuntu-printing-app/components/PrintRow.qml:74
92msgid "Print"
93msgstr ""
94
95#: ../ubuntu-printing-app/ubuntu-printing-app.desktop.in.in.h:2
96msgid "Print;Printing;"
97msgstr ""
98
99#: ../ubuntu-printing-app/Main.qml:66
21msgid "Document is invalid"100msgid "Document is invalid"
22msgstr ""101msgstr ""
23102
24#: ubuntu-printing-app/Main.qml:69103#: ../ubuntu-printing-app/Main.qml:69
25msgid "Document not found"104msgid "Document not found"
26msgstr ""105msgstr ""
27106
28#: ubuntu-printing-app/Main.qml:72107#: ../ubuntu-printing-app/Main.qml:72
29msgid "Not a PDF document"108msgid "Not a PDF document"
30msgstr ""109msgstr ""
31110
32#: ubuntu-printing-app/Main.qml:75111#: ../ubuntu-printing-app/Main.qml:75
33msgid "An unknown error occurred"112msgid "An unknown error occurred"
34msgstr ""113msgstr ""
35114
36#: ubuntu-printing-app/Main.qml:99115#: ../ubuntu-printing-app/Main.qml:99
37msgid "Error"116msgid "Error"
38msgstr ""117msgstr ""
39118
40#: ubuntu-printing-app/Main.qml:126119#: ../ubuntu-printing-app/Main.qml:126
41msgid "URL of PDF to print"120msgid "URL of PDF to print"
42msgstr ""121msgstr ""
43122
44#: ubuntu-printing-app/components/AlertDialog.qml:28123#: ../ubuntu-printing-app/pages/EmptyPage.qml:48
45msgid "OK"
46msgstr ""
47
48#: ubuntu-printing-app/components/PrintRow.qml:57
49msgid "Cancel"
50msgstr ""
51
52#: ubuntu-printing-app/components/PrintRow.qml:71
53msgid "Create PDF"
54msgstr ""
55
56#: ubuntu-printing-app/components/PrintRow.qml:71
57#: po/ubuntu-printing-app/ubuntu-printing-app.desktop.in.in.h:1
58msgid "Print"
59msgstr ""
60
61#: ubuntu-printing-app/components/PrintRow.qml:71
62msgid "Sheets"
63msgstr ""
64
65#: ubuntu-printing-app/pages/ContentPeerPickerPage.qml:43
66msgid "Open With..."
67msgstr ""
68
69#: ubuntu-printing-app/pages/EmptyPage.qml:48
70msgid ""124msgid ""
71"No document was chosen for printing. In order to print, you need to select "125"No document was chosen for printing. In order to print, you need to select "
72"print from an app. Alternatively you can export a PDF document from an app."126"print from an app. Alternatively you can export a PDF document from an app."
73msgstr ""127msgstr ""
74128
75#: ubuntu-printing-app/pages/PrintPage.qml:47129#: ../ubuntu-printing-app/pages/PrintPage.qml:47
76msgid "Page Setup"130msgid "Page Setup"
77msgstr ""131msgstr ""
78132
79#: ubuntu-printing-app/pages/PrintPage.qml:47133#: ../ubuntu-printing-app/pages/PrintPage.qml:47
80msgid "Printer Options"134msgid "Printer Options"
81msgstr ""135msgstr ""
82136
83#: ubuntu-printing-app/pages/PrintPage.qml:85137#: ../ubuntu-printing-app/pages/PrintPage.qml:86
84msgid "Printer"138msgid "Printer"
85msgstr ""139msgstr ""
86140
87#: ubuntu-printing-app/pages/PrintPage.qml:106141#: ../ubuntu-printing-app/pages/PrintPage.qml:107
88msgid "Copies"142msgid "Copies"
89msgstr ""143msgstr ""
90144
91#: ubuntu-printing-app/pages/PrintPage.qml:129145#: ../ubuntu-printing-app/pages/PrintPage.qml:131
92msgid "Collate"
93msgstr ""
94
95#: ubuntu-printing-app/pages/PrintPage.qml:149
96msgid "Reverse"
97msgstr ""
98
99#: ubuntu-printing-app/pages/PrintPage.qml:170
100msgid "All"146msgid "All"
101msgstr ""147msgstr ""
102148
103#: ubuntu-printing-app/pages/PrintPage.qml:170149#: ../ubuntu-printing-app/pages/PrintPage.qml:131
104msgid "Range"150msgid "Range"
105msgstr ""151msgstr ""
106152
107#: ubuntu-printing-app/pages/PrintPage.qml:174153#: ../ubuntu-printing-app/pages/PrintPage.qml:135
108msgid "Pages"154msgid "Pages"
109msgstr ""155msgstr ""
110156
111#: ubuntu-printing-app/pages/PrintPage.qml:216157#: ../ubuntu-printing-app/pages/PrintPage.qml:177
112msgid "eg 1-3,8"158msgid "eg 1-3,8"
113msgstr ""159msgstr ""
114160
115#: ubuntu-printing-app/pages/PrintPage.qml:225161#: ../ubuntu-printing-app/pages/PrintPage.qml:186
116msgid "Two-sided"162msgid "Two-sided"
117msgstr ""163msgstr ""
118164
119#: ubuntu-printing-app/pages/PrintPage.qml:246165#: ../ubuntu-printing-app/pages/PrintPage.qml:207
120msgid "Color"166msgid "Color"
121msgstr ""167msgstr ""
122168
123#: ubuntu-printing-app/pages/PrintPage.qml:267169#: ../ubuntu-printing-app/pages/PrintPage.qml:228
124msgid "Quality"170msgid "Quality"
125msgstr ""171msgstr ""
126172
127#: po/ubuntu-printing-app/ubuntu-printing-app.desktop.in.in.h:2173#: ../ubuntu-printing-app/pages/PrintPage.qml:246
128msgid "Print;Printing;"174msgid "Collate"
175msgstr ""
176
177#: ../ubuntu-printing-app/pages/PrintPage.qml:266
178msgid "Reverse"
179msgstr ""
180
181#: ../ubuntu-printing-app/pages/ContentPeerPickerPage.qml:43
182msgid "Open With..."
183msgstr ""
184
185#. Text color is determined from background color so set from html
186#: ../ubuntu-printing-app/components/PrintRow.qml:60
187msgid "Cancel"
188msgstr ""
189
190#: ../ubuntu-printing-app/components/PrintRow.qml:74
191msgid "Create PDF"
192msgstr ""
193
194#: ../ubuntu-printing-app/components/PrintRow.qml:74
195msgid "Sheets"
129msgstr ""196msgstr ""
130197
=== modified file 'ubuntu-printing-app/CMakeLists.txt'
--- ubuntu-printing-app/CMakeLists.txt 2017-01-20 12:36:56 +0000
+++ ubuntu-printing-app/CMakeLists.txt 2017-03-17 21:17:09 +0000
@@ -12,10 +12,11 @@
1212
13# Install desktop file13# Install desktop file
14configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_FILE}.in.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in)14configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${DESKTOP_FILE}.in.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in)
1515intltool_merge_translations(
16add_custom_target(${DESKTOP_FILE} ALL16 "${DESKTOP_FILE}.in"
17 COMMENT "Merging translations into ${DESKTOP_FILE}"17 "${DESKTOP_FILE}"
18 COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}18 ALL
19 UTF8
19)20)
2021
21install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}22install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}

Subscribers

People subscribed via source and target branches

to all changes: