Merge lp:~mhr3/unity-scope-mediascanner/i18n-enablement into lp:unity-scope-mediascanner

Proposed by Michal Hruby
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 90
Merged at revision: 78
Proposed branch: lp:~mhr3/unity-scope-mediascanner/i18n-enablement
Merge into: lp:unity-scope-mediascanner
Prerequisite: lp:~unity-team/unity-scope-mediascanner/albumresults
Diff against target: 499 lines (+205/-61)
15 files modified
CMakeLists.txt (+6/-0)
data/CMakeLists.txt (+11/-42)
data/mediascanner-music.ini.in.in (+3/-3)
data/mediascanner-video.ini.in.in (+3/-3)
data/musicaggregator.ini.in.in (+3/-3)
data/videoaggregator.ini.in.in (+3/-3)
debian/control (+2/-1)
debian/unity-scope-mediascanner2.install (+1/-0)
po/CMakeLists.txt (+51/-0)
po/unity-scope-mediascanner.pot (+86/-0)
src/i18n.h (+24/-0)
src/music-scope.cpp (+6/-4)
src/musicaggregatorscope.cpp (+1/-0)
src/video-scope.cpp (+4/-2)
src/videoaggregatorscope.cpp (+1/-0)
To merge this branch: bzr merge lp:~mhr3/unity-scope-mediascanner/i18n-enablement
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Paweł Stołowski (community) Approve
Review via email: mp+217389@code.launchpad.net

Commit message

Add i18n support.

Description of the change

Add i18n support.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
86. By Michal Hruby

Add intltool to control file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
James Henstridge (jamesh) wrote :

9 + add_custom_command(OUTPUT ${SCOPE_CONFIG_FILES} COMMAND ${INTLTOOL_MERGE_BIN} -d ${CMAKE_CURRENT_SOURCE_DIR}/../po ${configfile}.in ${configfile} APPEND)

Shouldn't the OUTPUT be ${configfile} here? It will still be picked up by the custom target, if I understand the docs correctly, and would remove the need to use APPEND.

215 + add_custom_command(OUTPUT ${GENERATED_HEADERS} COMMAND ${INTLTOOL_EXTRACT_BIN} --type=gettext/ini --local ${inifile} APPEND)

Same would apply here.

Other than that, it looks good.

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

Thanks for this!

224 + ${CPPFILES} "${CMAKE_CURRENT_BINARY_DIR}/tmp/*.h"

Just a nitpick, butI've just noticed that in some cases the location of the translatable message in the .pot file is specified as an absolute path:

https://translations.launchpad.net/unity-scope-mediascanner/trunk/+pots/unity-scope-mediascanner/ca/8/+translate

Traditionally relative paths are used in the .pot file. Is there a way the second list of files' paths can be specified as a relative path, just as ${CPPFILES}?

87. By Michal Hruby

Stop using add_custom_command with APPEND

88. By Michal Hruby

Add proper depends

89. By Michal Hruby

Update the pot file

90. By Michal Hruby

One more string update

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good, I've quickly hacked a translation file and it got processed and installed properly. +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
91. By Michal Hruby

Remove extra message

92. By Michal Hruby

Merge trunk

93. By Michal Hruby

Added missing setlocale calls

94. By Michal Hruby

Properly install the mo files

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-03-04 10:04:37 +0000
3+++ CMakeLists.txt 2014-04-30 09:50:48 +0000
4@@ -14,6 +14,11 @@
5 mediascanner-2.0
6 )
7
8+find_program(XGETTEXT_BIN xgettext)
9+find_program(MSGFMT_BIN msgfmt)
10+find_program(INTLTOOL_EXTRACT_BIN intltool-extract)
11+find_program(INTLTOOL_MERGE_BIN intltool-merge)
12+
13 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wmissing-prototypes -pedantic -std=c99")
14 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wmissing-declarations -pedantic -std=c++11")
15
16@@ -32,6 +37,7 @@
17 )
18 include_directories(${CMAKE_CURRENT_BINARY_DIR})
19
20+add_subdirectory("po")
21 add_subdirectory("src")
22 add_subdirectory("oldscope")
23 add_subdirectory("data")
24
25=== modified file 'data/CMakeLists.txt'
26--- data/CMakeLists.txt 2014-03-06 16:03:00 +0000
27+++ data/CMakeLists.txt 2014-04-30 09:50:48 +0000
28@@ -4,64 +4,33 @@
29 set(SCOPES_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes")
30 set(OLD_SCOPES_DIR "${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes")
31
32-configure_file(
33- mediascanner-music.ini.in
34- mediascanner-music.ini
35-)
36-
37-install(
38- FILES "${CMAKE_CURRENT_BINARY_DIR}/mediascanner-music.ini"
39- DESTINATION "${SCOPES_LIBDIR}/mediascanner-music"
40-)
41+set(SCOPE_CONFIG_FILES mediascanner-music.ini mediascanner-video.ini musicaggregator.ini videoaggregator.ini)
42+
43+foreach(configfile ${SCOPE_CONFIG_FILES})
44+ configure_file(${configfile}.in.in ${configfile}.in)
45+ get_filename_component(basename ${configfile} NAME_WE)
46+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${configfile}"
47+ DESTINATION "${SCOPES_LIBDIR}/${basename}")
48+ add_custom_command(OUTPUT ${configfile} COMMAND ${INTLTOOL_MERGE_BIN} -d ${CMAKE_CURRENT_SOURCE_DIR}/../po ${configfile}.in ${configfile})
49+endforeach()
50+
51+add_custom_target(ini-i18n ALL DEPENDS ${SCOPE_CONFIG_FILES})
52
53 install(
54 FILES music.png mediascanner-music-screenshot.jpg
55 DESTINATION "${SCOPES_DATADIR}/mediascanner-music"
56 )
57
58-
59-configure_file(
60- mediascanner-video.ini.in
61- mediascanner-video.ini
62-)
63-
64 install(
65 FILES video.png mediascanner-video-screenshot.jpg
66 DESTINATION "${SCOPES_DATADIR}/mediascanner-video"
67 )
68
69 install(
70- FILES "${CMAKE_CURRENT_BINARY_DIR}/mediascanner-video.ini"
71- DESTINATION "${SCOPES_LIBDIR}/mediascanner-video"
72-)
73-
74-
75-configure_file(
76- musicaggregator.ini.in
77- musicaggregator.ini
78-)
79-
80-install(
81- FILES "${CMAKE_CURRENT_BINARY_DIR}/musicaggregator.ini"
82- DESTINATION "${SCOPES_LIBDIR}/musicaggregator"
83-)
84-
85-install(
86 FILES musicaggregator-screenshot.jpg
87 DESTINATION "${SCOPES_DATADIR}/musicaggregator"
88 )
89
90-
91-configure_file(
92- videoaggregator.ini.in
93- videoaggregator.ini
94-)
95-
96-install(
97- FILES "${CMAKE_CURRENT_BINARY_DIR}/videoaggregator.ini"
98- DESTINATION "${SCOPES_LIBDIR}/videoaggregator"
99-)
100-
101 install(
102 FILES videoaggregator-screenshot.jpg
103 DESTINATION "${SCOPES_DATADIR}/videoaggregator"
104
105=== renamed file 'data/mediascanner-music.ini.in' => 'data/mediascanner-music.ini.in.in'
106--- data/mediascanner-music.ini.in 2014-03-06 16:03:00 +0000
107+++ data/mediascanner-music.ini.in.in 2014-04-30 09:50:48 +0000
108@@ -1,10 +1,10 @@
109 [ScopeConfig]
110-DisplayName=Local Music
111-Description=This is an Ubuntu search plugin that enables information from local music to be searched and displayed in the Dash underneath the Music header. If you do not wish to search this content source, you can disable this search plugin.
112+_DisplayName=Local Music
113+_Description=This is an Ubuntu search plugin that scans the device for music and allows it to be searched and displayed in the Dash.
114 Author=Canonical Ltd.
115 Art=@SCOPES_DATADIR@/mediascanner-music/mediascanner-music-screenshot.jpg
116 Icon=@SCOPES_DATADIR@/mediascanner-music/music.png
117-SearchHint=Search local music collection
118+_SearchHint=Search local music collection
119 HotKey=
120
121 [Desktop Entry]
122
123=== renamed file 'data/mediascanner-video.ini.in' => 'data/mediascanner-video.ini.in.in'
124--- data/mediascanner-video.ini.in 2014-03-06 16:03:00 +0000
125+++ data/mediascanner-video.ini.in.in 2014-04-30 09:50:48 +0000
126@@ -1,10 +1,10 @@
127 [ScopeConfig]
128-DisplayName=Local Videos
129-Description=This is an Ubuntu search plugin that enables local videos to be searched and displayed in the Dash underneath the Video header. If you do not wish to search this content source, you can disable this search plugin.
130+_DisplayName=Local Videos
131+_Description=This is an Ubuntu search plugin that scans the device for videos and allows them to be searched and displayed in the Dash.
132 Author=Canonical Ltd.
133 Art=@SCOPES_DATADIR@/mediascanner-video/mediascanner-video-screenshot.jpg
134 Icon=@SCOPES_DATADIR@/mediascanner-video/video.png
135-SearchHint=
136+_SearchHint=
137 HotKey=
138
139 [Desktop Entry]
140
141=== renamed file 'data/musicaggregator.ini.in' => 'data/musicaggregator.ini.in.in'
142--- data/musicaggregator.ini.in 2014-03-06 16:03:00 +0000
143+++ data/musicaggregator.ini.in.in 2014-04-30 09:50:48 +0000
144@@ -1,10 +1,10 @@
145 [ScopeConfig]
146-DisplayName=Music
147-Description=This is an Ubuntu search plugin merges all music sources into one.
148+_DisplayName=Music
149+_Description=This is an Ubuntu search plugin that merges all music sources into one.
150 Author=Canonical Ltd.
151 Art=@SCOPES_DATADIR@/musicaggregator/musicaggregator-screenshot.jpg
152 Icon=@SCOPES_DATADIR@/mediascanner-music/music.png
153-SearchHint=Search music
154+_SearchHint=Search music
155 HotKey=
156
157 [Desktop Entry]
158
159=== renamed file 'data/videoaggregator.ini.in' => 'data/videoaggregator.ini.in.in'
160--- data/videoaggregator.ini.in 2014-03-06 16:03:00 +0000
161+++ data/videoaggregator.ini.in.in 2014-04-30 09:50:48 +0000
162@@ -1,10 +1,10 @@
163 [ScopeConfig]
164-DisplayName=Video
165-Description=This is an Ubuntu search plugin merges all video sources into one.
166+_DisplayName=Video
167+_Description=This is an Ubuntu search plugin that merges all video sources into one.
168 Author=Canonical Ltd.
169 Art=@SCOPES_DATADIR@/videoaggregator/videoaggregator-screenshot.jpg
170 Icon=@SCOPES_DATADIR@/mediascanner-video/video.png
171-SearchHint=Search video
172+_SearchHint=Search video
173 HotKey=
174
175 [Desktop Entry]
176
177=== modified file 'debian/control'
178--- debian/control 2014-03-04 10:07:12 +0000
179+++ debian/control 2014-04-30 09:50:48 +0000
180@@ -4,13 +4,14 @@
181 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
182 Build-Depends: cmake (>= 2.8),
183 debhelper (>= 9),
184- mediascanner2.0,
185+ intltool,
186 libmediascanner-2.0-dev (>= 0.99+14.04.20140219),
187 libunity-dev (>= 7.0.9),
188 libunity-scopes-dev (>= 0.4.0),
189 libglib2.0-dev,
190 libgtest-dev,
191 libsqlite3-dev,
192+ mediascanner2.0,
193 pkg-config,
194 python3,
195 python3-dbusmock,
196
197=== modified file 'debian/unity-scope-mediascanner2.install'
198--- debian/unity-scope-mediascanner2.install 2014-03-06 16:03:00 +0000
199+++ debian/unity-scope-mediascanner2.install 2014-04-30 09:50:48 +0000
200@@ -6,3 +6,4 @@
201 usr/share/unity/scopes/mediascanner-video/*
202 usr/share/unity/scopes/musicaggregator/*
203 usr/share/unity/scopes/videoaggregator/*
204+usr/share/locale
205
206=== added directory 'po'
207=== added file 'po/CMakeLists.txt'
208--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
209+++ po/CMakeLists.txt 2014-04-30 09:50:48 +0000
210@@ -0,0 +1,51 @@
211+file(GLOB CPPFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
212+ "${CMAKE_SOURCE_DIR}/src/*.cpp")
213+file(GLOB INIFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
214+ "${CMAKE_SOURCE_DIR}/data/*.ini.in.in")
215+
216+foreach(inifile ${INIFILES})
217+ get_filename_component(fname ${inifile} NAME)
218+ set(iniheaderfile "${CMAKE_CURRENT_SOURCE_DIR}/tmp/${fname}.h")
219+ list(APPEND GENERATED_HEADERS ${iniheaderfile})
220+ add_custom_command(OUTPUT ${iniheaderfile}
221+ COMMAND ${INTLTOOL_EXTRACT_BIN} --type=gettext/ini --local ${inifile}
222+ DEPENDS ${inifile}
223+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
224+ )
225+endforeach()
226+
227+add_custom_target(pot-ini
228+ DEPENDS ${GENERATED_HEADERS}
229+)
230+
231+add_custom_target(pot
232+ COMMAND ${XGETTEXT_BIN} -o ${GETTEXT_PACKAGE}.pot
233+ --copyright=\"Canonical Ltd.\"
234+ --package-name ${GETTEXT_PACKAGE}
235+ --c++ --add-comments=TRANSLATORS
236+ --keyword=_ --keyword=N_ --from-code=UTF-8
237+ ${CPPFILES} "tmp/*.h"
238+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
239+ DEPENDS pot-ini
240+)
241+
242+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale)
243+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale DESTINATION share)
244+
245+file(GLOB pofiles *.po)
246+foreach(f ${pofiles})
247+ get_filename_component(pofile ${f} NAME_WE)
248+ set(languages "${pofile};${languages}")
249+endforeach()
250+
251+foreach(i ${languages})
252+ add_custom_command(OUTPUT ${i}.mo
253+ COMMAND ${MSGFMT_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/${i}.po -o ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo
254+ DEPENDS ${i}.po
255+ )
256+ add_custom_target(${i}gen ALL DEPENDS ${i}.mo)
257+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo
258+ DESTINATION share/locale/${i}/LC_MESSAGES
259+ RENAME ${GETTEXT_PACKAGE}.mo)
260+endforeach()
261+
262
263=== added file 'po/unity-scope-mediascanner.pot'
264--- po/unity-scope-mediascanner.pot 1970-01-01 00:00:00 +0000
265+++ po/unity-scope-mediascanner.pot 2014-04-30 09:50:48 +0000
266@@ -0,0 +1,86 @@
267+# SOME DESCRIPTIVE TITLE.
268+# Copyright (C) YEAR Canonical Ltd.
269+# This file is distributed under the same license as the PACKAGE package.
270+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
271+#
272+#, fuzzy
273+msgid ""
274+msgstr ""
275+"Project-Id-Version: unity-scope-mediascanner\n"
276+"Report-Msgid-Bugs-To: \n"
277+"POT-Creation-Date: 2014-04-29 17:23+0100\n"
278+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
279+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
280+"Language-Team: LANGUAGE <LL@li.org>\n"
281+"Language: \n"
282+"MIME-Version: 1.0\n"
283+"Content-Type: text/plain; charset=CHARSET\n"
284+"Content-Transfer-Encoding: 8bit\n"
285+
286+#: ../src/music-scope.cpp:122
287+msgid "Songs"
288+msgstr ""
289+
290+#: ../src/music-scope.cpp:159
291+msgid "Albums"
292+msgstr ""
293+
294+#: ../src/music-scope.cpp:241 ../src/music-scope.cpp:278
295+msgid "Play in music app"
296+msgstr ""
297+
298+#: ../src/video-scope.cpp:102
299+msgid "My Videos"
300+msgstr ""
301+
302+#: ../src/video-scope.cpp:151
303+msgid "Play"
304+msgstr ""
305+
306+#: tmp/mediascanner-music.ini.in.in.h:1
307+msgid "Local Music"
308+msgstr ""
309+
310+#: tmp/mediascanner-music.ini.in.in.h:2
311+msgid ""
312+"This is an Ubuntu search plugin that scans the device for music and allows "
313+"it to be searched and displayed in the Dash."
314+msgstr ""
315+
316+#: tmp/mediascanner-music.ini.in.in.h:3
317+msgid "Search local music collection"
318+msgstr ""
319+
320+#: tmp/mediascanner-video.ini.in.in.h:1
321+msgid "Local Videos"
322+msgstr ""
323+
324+#: tmp/mediascanner-video.ini.in.in.h:2
325+msgid ""
326+"This is an Ubuntu search plugin that scans the device for videos and allows "
327+"them to be searched and displayed in the Dash."
328+msgstr ""
329+
330+#: tmp/musicaggregator.ini.in.in.h:1
331+msgid "Music"
332+msgstr ""
333+
334+#: tmp/musicaggregator.ini.in.in.h:2
335+msgid "This is an Ubuntu search plugin that merges all music sources into one."
336+msgstr ""
337+
338+#: tmp/musicaggregator.ini.in.in.h:3
339+msgid "Search music"
340+msgstr ""
341+
342+#: tmp/videoaggregator.ini.in.in.h:1
343+msgid "Video"
344+msgstr ""
345+
346+#: tmp/videoaggregator.ini.in.in.h:2
347+msgid "This is an Ubuntu search plugin that merges all video sources into one."
348+msgstr ""
349+
350+#: tmp/videoaggregator.ini.in.in.h:3
351+msgid "Search video"
352+msgstr ""
353
354=== added file 'src/i18n.h'
355--- src/i18n.h 1970-01-01 00:00:00 +0000
356+++ src/i18n.h 2014-04-30 09:50:48 +0000
357@@ -0,0 +1,24 @@
358+/*
359+ * Copyright (C) 2014 Canonical Ltd.
360+ *
361+ * This program is free software: you can redistribute it and/or modify it
362+ * under the terms of the GNU General Public License version 3, as published
363+ * by the Free Software Foundation.
364+ *
365+ * This program is distributed in the hope that it will be useful, but
366+ * WITHOUT ANY WARRANTY; without even the implied warranties of
367+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
368+ * PURPOSE. See the GNU General Public License for more details.
369+ *
370+ * You should have received a copy of the GNU General Public License along
371+ * with this program. If not, see <http://www.gnu.org/licenses/>.
372+ */
373+
374+#ifndef SCOPE_I18N_H
375+#define SCOPE_I18N_H
376+
377+#include <libintl.h>
378+
379+#define _(value) dgettext(GETTEXT_PACKAGE, value)
380+
381+#endif
382
383=== modified file 'src/music-scope.cpp'
384--- src/music-scope.cpp 2014-04-14 13:31:00 +0000
385+++ src/music-scope.cpp 2014-04-30 09:50:48 +0000
386@@ -28,6 +28,7 @@
387 #include <unity/scopes/VariantBuilder.h>
388
389 #include "music-scope.h"
390+#include "i18n.h"
391
392 #define MAX_RESULTS 100
393
394@@ -84,6 +85,7 @@
395 using namespace unity::scopes;
396
397 int MusicScope::start(std::string const&, RegistryProxy const&) {
398+ setlocale(LC_ALL, "");
399 store.reset(new MediaStore(MS_READ_ONLY));
400 return VERSION;
401 }
402@@ -118,7 +120,7 @@
403
404 void MusicQuery::query_songs(unity::scopes::SearchReplyProxy const&reply) const {
405 CategoryRenderer renderer(query.query_string() == "" ? SONGS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
406- auto cat = reply->register_category("songs", "Songs", SONGS_CATEGORY_ICON, renderer);
407+ auto cat = reply->register_category("songs", _("Songs"), SONGS_CATEGORY_ICON, renderer);
408 for (const auto &media : scope.store->query(query.query_string(), AudioMedia, MAX_RESULTS)) {
409 CategorisedResult res(cat);
410 res.set_uri(media.getUri());
411@@ -155,7 +157,7 @@
412
413 void MusicQuery::query_albums(unity::scopes::SearchReplyProxy const&reply) const {
414 CategoryRenderer renderer(query.query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
415- auto cat = reply->register_category("albums", "Albums", SONGS_CATEGORY_ICON, renderer);
416+ auto cat = reply->register_category("albums", _("Albums"), SONGS_CATEGORY_ICON, renderer);
417 for (const auto &album : scope.store->queryAlbums(query.query_string(), MAX_RESULTS)) {
418 CategorisedResult res(cat);
419 res.set_uri("album:///" + uriencode(album.getArtist()) + "/" +
420@@ -237,7 +239,7 @@
421 VariantBuilder builder;
422 builder.add_tuple({
423 {"id", Variant("play")},
424- {"label", Variant("Play in music app")}
425+ {"label", Variant(_("Play in music app"))}
426 });
427 actions.add_attribute_value("actions", builder.end());
428 }
429@@ -274,7 +276,7 @@
430 VariantBuilder builder;
431 builder.add_tuple({
432 {"uri", Variant(result.uri())},
433- {"label", Variant("Play in music app")}
434+ {"label", Variant(_("Play in music app"))}
435 });
436 actions.add_attribute_value("actions", builder.end());
437 }
438
439=== modified file 'src/musicaggregatorscope.cpp'
440--- src/musicaggregatorscope.cpp 2014-03-19 13:59:25 +0000
441+++ src/musicaggregatorscope.cpp 2014-04-30 09:50:48 +0000
442@@ -30,6 +30,7 @@
443 const char *ONLINESCOPE = "com.canonical.scopes.grooveshark";
444
445 int MusicAggregatorScope::start(std::string const&, unity::scopes::RegistryProxy const& registry) {
446+ setlocale(LC_ALL, "");
447 this->registry = registry;
448 CategoryRenderer basic;
449 local_scope = registry->get_metadata(LOCALSCOPE).proxy();
450
451=== modified file 'src/video-scope.cpp'
452--- src/video-scope.cpp 2014-03-12 17:11:31 +0000
453+++ src/video-scope.cpp 2014-04-30 09:50:48 +0000
454@@ -27,6 +27,7 @@
455 #include <unity/scopes/VariantBuilder.h>
456
457 #include "video-scope.h"
458+#include "i18n.h"
459
460 #define MAX_RESULTS 100
461
462@@ -69,6 +70,7 @@
463 )";
464
465 int VideoScope::start(std::string const&, RegistryProxy const&) {
466+ setlocale(LC_ALL, "");
467 store.reset(new MediaStore(MS_READ_ONLY));
468 return VERSION;
469 }
470@@ -98,7 +100,7 @@
471
472 void VideoQuery::run(SearchReplyProxy const&reply) {
473 CategoryRenderer renderer(query.query_string() == "" ? LOCAL_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
474- auto cat = reply->register_category("local", "My Videos", LOCAL_CATEGORY_ICON, renderer);
475+ auto cat = reply->register_category("local", _("My Videos"), LOCAL_CATEGORY_ICON, renderer);
476 for (const auto &media : scope.store->query(query.query_string(), VideoMedia, MAX_RESULTS)) {
477 CategorisedResult res(cat);
478 res.set_uri(media.getUri());
479@@ -147,7 +149,7 @@
480 VariantBuilder builder;
481 builder.add_tuple({
482 {"id", Variant("play")},
483- {"label", Variant("Play")}
484+ {"label", Variant(_("Play"))}
485 });
486 actions.add_attribute_value("actions", builder.end());
487 }
488
489=== modified file 'src/videoaggregatorscope.cpp'
490--- src/videoaggregatorscope.cpp 2014-03-19 13:59:25 +0000
491+++ src/videoaggregatorscope.cpp 2014-04-30 09:50:48 +0000
492@@ -30,6 +30,7 @@
493 const char *ONLINESCOPE = "com.canonical.scopes.remotevideos";
494
495 int VideoAggregatorScope::start(std::string const&, unity::scopes::RegistryProxy const& registry) {
496+ setlocale(LC_ALL, "");
497 this->registry = registry;
498 CategoryRenderer basic;
499 local_scope = registry->get_metadata(LOCALSCOPE).proxy();

Subscribers

People subscribed via source and target branches

to all changes: