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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-03-04 10:04:37 +0000
+++ CMakeLists.txt 2014-04-30 09:50:48 +0000
@@ -14,6 +14,11 @@
14 mediascanner-2.014 mediascanner-2.0
15)15)
1616
17find_program(XGETTEXT_BIN xgettext)
18find_program(MSGFMT_BIN msgfmt)
19find_program(INTLTOOL_EXTRACT_BIN intltool-extract)
20find_program(INTLTOOL_MERGE_BIN intltool-merge)
21
17set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wmissing-prototypes -pedantic -std=c99")22set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wmissing-prototypes -pedantic -std=c99")
18set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wmissing-declarations -pedantic -std=c++11")23set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wmissing-declarations -pedantic -std=c++11")
1924
@@ -32,6 +37,7 @@
32)37)
33include_directories(${CMAKE_CURRENT_BINARY_DIR})38include_directories(${CMAKE_CURRENT_BINARY_DIR})
3439
40add_subdirectory("po")
35add_subdirectory("src")41add_subdirectory("src")
36add_subdirectory("oldscope")42add_subdirectory("oldscope")
37add_subdirectory("data")43add_subdirectory("data")
3844
=== modified file 'data/CMakeLists.txt'
--- data/CMakeLists.txt 2014-03-06 16:03:00 +0000
+++ data/CMakeLists.txt 2014-04-30 09:50:48 +0000
@@ -4,64 +4,33 @@
4set(SCOPES_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes")4set(SCOPES_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes")
5set(OLD_SCOPES_DIR "${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes")5set(OLD_SCOPES_DIR "${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes")
66
7configure_file(7set(SCOPE_CONFIG_FILES mediascanner-music.ini mediascanner-video.ini musicaggregator.ini videoaggregator.ini)
8 mediascanner-music.ini.in8
9 mediascanner-music.ini9foreach(configfile ${SCOPE_CONFIG_FILES})
10)10 configure_file(${configfile}.in.in ${configfile}.in)
1111 get_filename_component(basename ${configfile} NAME_WE)
12install(12 install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${configfile}"
13 FILES "${CMAKE_CURRENT_BINARY_DIR}/mediascanner-music.ini"13 DESTINATION "${SCOPES_LIBDIR}/${basename}")
14 DESTINATION "${SCOPES_LIBDIR}/mediascanner-music"14 add_custom_command(OUTPUT ${configfile} COMMAND ${INTLTOOL_MERGE_BIN} -d ${CMAKE_CURRENT_SOURCE_DIR}/../po ${configfile}.in ${configfile})
15)15endforeach()
16
17add_custom_target(ini-i18n ALL DEPENDS ${SCOPE_CONFIG_FILES})
1618
17install(19install(
18 FILES music.png mediascanner-music-screenshot.jpg20 FILES music.png mediascanner-music-screenshot.jpg
19 DESTINATION "${SCOPES_DATADIR}/mediascanner-music"21 DESTINATION "${SCOPES_DATADIR}/mediascanner-music"
20)22)
2123
22
23configure_file(
24 mediascanner-video.ini.in
25 mediascanner-video.ini
26)
27
28install(24install(
29 FILES video.png mediascanner-video-screenshot.jpg25 FILES video.png mediascanner-video-screenshot.jpg
30 DESTINATION "${SCOPES_DATADIR}/mediascanner-video"26 DESTINATION "${SCOPES_DATADIR}/mediascanner-video"
31)27)
3228
33install(29install(
34 FILES "${CMAKE_CURRENT_BINARY_DIR}/mediascanner-video.ini"
35 DESTINATION "${SCOPES_LIBDIR}/mediascanner-video"
36)
37
38
39configure_file(
40 musicaggregator.ini.in
41 musicaggregator.ini
42)
43
44install(
45 FILES "${CMAKE_CURRENT_BINARY_DIR}/musicaggregator.ini"
46 DESTINATION "${SCOPES_LIBDIR}/musicaggregator"
47)
48
49install(
50 FILES musicaggregator-screenshot.jpg30 FILES musicaggregator-screenshot.jpg
51 DESTINATION "${SCOPES_DATADIR}/musicaggregator"31 DESTINATION "${SCOPES_DATADIR}/musicaggregator"
52)32)
5333
54
55configure_file(
56 videoaggregator.ini.in
57 videoaggregator.ini
58)
59
60install(
61 FILES "${CMAKE_CURRENT_BINARY_DIR}/videoaggregator.ini"
62 DESTINATION "${SCOPES_LIBDIR}/videoaggregator"
63)
64
65install(34install(
66 FILES videoaggregator-screenshot.jpg35 FILES videoaggregator-screenshot.jpg
67 DESTINATION "${SCOPES_DATADIR}/videoaggregator"36 DESTINATION "${SCOPES_DATADIR}/videoaggregator"
6837
=== renamed file 'data/mediascanner-music.ini.in' => 'data/mediascanner-music.ini.in.in'
--- data/mediascanner-music.ini.in 2014-03-06 16:03:00 +0000
+++ data/mediascanner-music.ini.in.in 2014-04-30 09:50:48 +0000
@@ -1,10 +1,10 @@
1[ScopeConfig]1[ScopeConfig]
2DisplayName=Local Music2_DisplayName=Local Music
3Description=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.3_Description=This is an Ubuntu search plugin that scans the device for music and allows it to be searched and displayed in the Dash.
4Author=Canonical Ltd.4Author=Canonical Ltd.
5Art=@SCOPES_DATADIR@/mediascanner-music/mediascanner-music-screenshot.jpg5Art=@SCOPES_DATADIR@/mediascanner-music/mediascanner-music-screenshot.jpg
6Icon=@SCOPES_DATADIR@/mediascanner-music/music.png6Icon=@SCOPES_DATADIR@/mediascanner-music/music.png
7SearchHint=Search local music collection7_SearchHint=Search local music collection
8HotKey=8HotKey=
99
10[Desktop Entry]10[Desktop Entry]
1111
=== renamed file 'data/mediascanner-video.ini.in' => 'data/mediascanner-video.ini.in.in'
--- data/mediascanner-video.ini.in 2014-03-06 16:03:00 +0000
+++ data/mediascanner-video.ini.in.in 2014-04-30 09:50:48 +0000
@@ -1,10 +1,10 @@
1[ScopeConfig]1[ScopeConfig]
2DisplayName=Local Videos2_DisplayName=Local Videos
3Description=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.3_Description=This is an Ubuntu search plugin that scans the device for videos and allows them to be searched and displayed in the Dash.
4Author=Canonical Ltd.4Author=Canonical Ltd.
5Art=@SCOPES_DATADIR@/mediascanner-video/mediascanner-video-screenshot.jpg5Art=@SCOPES_DATADIR@/mediascanner-video/mediascanner-video-screenshot.jpg
6Icon=@SCOPES_DATADIR@/mediascanner-video/video.png6Icon=@SCOPES_DATADIR@/mediascanner-video/video.png
7SearchHint=7_SearchHint=
8HotKey=8HotKey=
99
10[Desktop Entry]10[Desktop Entry]
1111
=== renamed file 'data/musicaggregator.ini.in' => 'data/musicaggregator.ini.in.in'
--- data/musicaggregator.ini.in 2014-03-06 16:03:00 +0000
+++ data/musicaggregator.ini.in.in 2014-04-30 09:50:48 +0000
@@ -1,10 +1,10 @@
1[ScopeConfig]1[ScopeConfig]
2DisplayName=Music2_DisplayName=Music
3Description=This is an Ubuntu search plugin merges all music sources into one.3_Description=This is an Ubuntu search plugin that merges all music sources into one.
4Author=Canonical Ltd.4Author=Canonical Ltd.
5Art=@SCOPES_DATADIR@/musicaggregator/musicaggregator-screenshot.jpg5Art=@SCOPES_DATADIR@/musicaggregator/musicaggregator-screenshot.jpg
6Icon=@SCOPES_DATADIR@/mediascanner-music/music.png6Icon=@SCOPES_DATADIR@/mediascanner-music/music.png
7SearchHint=Search music7_SearchHint=Search music
8HotKey=8HotKey=
99
10[Desktop Entry]10[Desktop Entry]
1111
=== renamed file 'data/videoaggregator.ini.in' => 'data/videoaggregator.ini.in.in'
--- data/videoaggregator.ini.in 2014-03-06 16:03:00 +0000
+++ data/videoaggregator.ini.in.in 2014-04-30 09:50:48 +0000
@@ -1,10 +1,10 @@
1[ScopeConfig]1[ScopeConfig]
2DisplayName=Video2_DisplayName=Video
3Description=This is an Ubuntu search plugin merges all video sources into one.3_Description=This is an Ubuntu search plugin that merges all video sources into one.
4Author=Canonical Ltd.4Author=Canonical Ltd.
5Art=@SCOPES_DATADIR@/videoaggregator/videoaggregator-screenshot.jpg5Art=@SCOPES_DATADIR@/videoaggregator/videoaggregator-screenshot.jpg
6Icon=@SCOPES_DATADIR@/mediascanner-video/video.png6Icon=@SCOPES_DATADIR@/mediascanner-video/video.png
7SearchHint=Search video7_SearchHint=Search video
8HotKey=8HotKey=
99
10[Desktop Entry]10[Desktop Entry]
1111
=== modified file 'debian/control'
--- debian/control 2014-03-04 10:07:12 +0000
+++ debian/control 2014-04-30 09:50:48 +0000
@@ -4,13 +4,14 @@
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5Build-Depends: cmake (>= 2.8),5Build-Depends: cmake (>= 2.8),
6 debhelper (>= 9),6 debhelper (>= 9),
7 mediascanner2.0,7 intltool,
8 libmediascanner-2.0-dev (>= 0.99+14.04.20140219),8 libmediascanner-2.0-dev (>= 0.99+14.04.20140219),
9 libunity-dev (>= 7.0.9),9 libunity-dev (>= 7.0.9),
10 libunity-scopes-dev (>= 0.4.0),10 libunity-scopes-dev (>= 0.4.0),
11 libglib2.0-dev,11 libglib2.0-dev,
12 libgtest-dev,12 libgtest-dev,
13 libsqlite3-dev,13 libsqlite3-dev,
14 mediascanner2.0,
14 pkg-config,15 pkg-config,
15 python3,16 python3,
16 python3-dbusmock,17 python3-dbusmock,
1718
=== modified file 'debian/unity-scope-mediascanner2.install'
--- debian/unity-scope-mediascanner2.install 2014-03-06 16:03:00 +0000
+++ debian/unity-scope-mediascanner2.install 2014-04-30 09:50:48 +0000
@@ -6,3 +6,4 @@
6usr/share/unity/scopes/mediascanner-video/*6usr/share/unity/scopes/mediascanner-video/*
7usr/share/unity/scopes/musicaggregator/*7usr/share/unity/scopes/musicaggregator/*
8usr/share/unity/scopes/videoaggregator/*8usr/share/unity/scopes/videoaggregator/*
9usr/share/locale
910
=== added directory 'po'
=== added file 'po/CMakeLists.txt'
--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ po/CMakeLists.txt 2014-04-30 09:50:48 +0000
@@ -0,0 +1,51 @@
1file(GLOB CPPFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
2 "${CMAKE_SOURCE_DIR}/src/*.cpp")
3file(GLOB INIFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
4 "${CMAKE_SOURCE_DIR}/data/*.ini.in.in")
5
6foreach(inifile ${INIFILES})
7 get_filename_component(fname ${inifile} NAME)
8 set(iniheaderfile "${CMAKE_CURRENT_SOURCE_DIR}/tmp/${fname}.h")
9 list(APPEND GENERATED_HEADERS ${iniheaderfile})
10 add_custom_command(OUTPUT ${iniheaderfile}
11 COMMAND ${INTLTOOL_EXTRACT_BIN} --type=gettext/ini --local ${inifile}
12 DEPENDS ${inifile}
13 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
14 )
15endforeach()
16
17add_custom_target(pot-ini
18 DEPENDS ${GENERATED_HEADERS}
19)
20
21add_custom_target(pot
22 COMMAND ${XGETTEXT_BIN} -o ${GETTEXT_PACKAGE}.pot
23 --copyright=\"Canonical Ltd.\"
24 --package-name ${GETTEXT_PACKAGE}
25 --c++ --add-comments=TRANSLATORS
26 --keyword=_ --keyword=N_ --from-code=UTF-8
27 ${CPPFILES} "tmp/*.h"
28 WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
29 DEPENDS pot-ini
30)
31
32file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale)
33install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale DESTINATION share)
34
35file(GLOB pofiles *.po)
36foreach(f ${pofiles})
37 get_filename_component(pofile ${f} NAME_WE)
38 set(languages "${pofile};${languages}")
39endforeach()
40
41foreach(i ${languages})
42 add_custom_command(OUTPUT ${i}.mo
43 COMMAND ${MSGFMT_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/${i}.po -o ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo
44 DEPENDS ${i}.po
45 )
46 add_custom_target(${i}gen ALL DEPENDS ${i}.mo)
47 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo
48 DESTINATION share/locale/${i}/LC_MESSAGES
49 RENAME ${GETTEXT_PACKAGE}.mo)
50endforeach()
51
052
=== added file 'po/unity-scope-mediascanner.pot'
--- po/unity-scope-mediascanner.pot 1970-01-01 00:00:00 +0000
+++ po/unity-scope-mediascanner.pot 2014-04-30 09:50:48 +0000
@@ -0,0 +1,86 @@
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: unity-scope-mediascanner\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-04-29 17:23+0100\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#: ../src/music-scope.cpp:122
21msgid "Songs"
22msgstr ""
23
24#: ../src/music-scope.cpp:159
25msgid "Albums"
26msgstr ""
27
28#: ../src/music-scope.cpp:241 ../src/music-scope.cpp:278
29msgid "Play in music app"
30msgstr ""
31
32#: ../src/video-scope.cpp:102
33msgid "My Videos"
34msgstr ""
35
36#: ../src/video-scope.cpp:151
37msgid "Play"
38msgstr ""
39
40#: tmp/mediascanner-music.ini.in.in.h:1
41msgid "Local Music"
42msgstr ""
43
44#: tmp/mediascanner-music.ini.in.in.h:2
45msgid ""
46"This is an Ubuntu search plugin that scans the device for music and allows "
47"it to be searched and displayed in the Dash."
48msgstr ""
49
50#: tmp/mediascanner-music.ini.in.in.h:3
51msgid "Search local music collection"
52msgstr ""
53
54#: tmp/mediascanner-video.ini.in.in.h:1
55msgid "Local Videos"
56msgstr ""
57
58#: tmp/mediascanner-video.ini.in.in.h:2
59msgid ""
60"This is an Ubuntu search plugin that scans the device for videos and allows "
61"them to be searched and displayed in the Dash."
62msgstr ""
63
64#: tmp/musicaggregator.ini.in.in.h:1
65msgid "Music"
66msgstr ""
67
68#: tmp/musicaggregator.ini.in.in.h:2
69msgid "This is an Ubuntu search plugin that merges all music sources into one."
70msgstr ""
71
72#: tmp/musicaggregator.ini.in.in.h:3
73msgid "Search music"
74msgstr ""
75
76#: tmp/videoaggregator.ini.in.in.h:1
77msgid "Video"
78msgstr ""
79
80#: tmp/videoaggregator.ini.in.in.h:2
81msgid "This is an Ubuntu search plugin that merges all video sources into one."
82msgstr ""
83
84#: tmp/videoaggregator.ini.in.in.h:3
85msgid "Search video"
86msgstr ""
087
=== added file 'src/i18n.h'
--- src/i18n.h 1970-01-01 00:00:00 +0000
+++ src/i18n.h 2014-04-30 09:50:48 +0000
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef SCOPE_I18N_H
18#define SCOPE_I18N_H
19
20#include <libintl.h>
21
22#define _(value) dgettext(GETTEXT_PACKAGE, value)
23
24#endif
025
=== modified file 'src/music-scope.cpp'
--- src/music-scope.cpp 2014-04-14 13:31:00 +0000
+++ src/music-scope.cpp 2014-04-30 09:50:48 +0000
@@ -28,6 +28,7 @@
28#include <unity/scopes/VariantBuilder.h>28#include <unity/scopes/VariantBuilder.h>
2929
30#include "music-scope.h"30#include "music-scope.h"
31#include "i18n.h"
3132
32#define MAX_RESULTS 10033#define MAX_RESULTS 100
3334
@@ -84,6 +85,7 @@
84using namespace unity::scopes;85using namespace unity::scopes;
8586
86int MusicScope::start(std::string const&, RegistryProxy const&) {87int MusicScope::start(std::string const&, RegistryProxy const&) {
88 setlocale(LC_ALL, "");
87 store.reset(new MediaStore(MS_READ_ONLY));89 store.reset(new MediaStore(MS_READ_ONLY));
88 return VERSION;90 return VERSION;
89}91}
@@ -118,7 +120,7 @@
118120
119void MusicQuery::query_songs(unity::scopes::SearchReplyProxy const&reply) const {121void MusicQuery::query_songs(unity::scopes::SearchReplyProxy const&reply) const {
120 CategoryRenderer renderer(query.query_string() == "" ? SONGS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);122 CategoryRenderer renderer(query.query_string() == "" ? SONGS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
121 auto cat = reply->register_category("songs", "Songs", SONGS_CATEGORY_ICON, renderer);123 auto cat = reply->register_category("songs", _("Songs"), SONGS_CATEGORY_ICON, renderer);
122 for (const auto &media : scope.store->query(query.query_string(), AudioMedia, MAX_RESULTS)) {124 for (const auto &media : scope.store->query(query.query_string(), AudioMedia, MAX_RESULTS)) {
123 CategorisedResult res(cat);125 CategorisedResult res(cat);
124 res.set_uri(media.getUri());126 res.set_uri(media.getUri());
@@ -155,7 +157,7 @@
155157
156void MusicQuery::query_albums(unity::scopes::SearchReplyProxy const&reply) const {158void MusicQuery::query_albums(unity::scopes::SearchReplyProxy const&reply) const {
157 CategoryRenderer renderer(query.query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);159 CategoryRenderer renderer(query.query_string() == "" ? ALBUMS_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
158 auto cat = reply->register_category("albums", "Albums", SONGS_CATEGORY_ICON, renderer);160 auto cat = reply->register_category("albums", _("Albums"), SONGS_CATEGORY_ICON, renderer);
159 for (const auto &album : scope.store->queryAlbums(query.query_string(), MAX_RESULTS)) {161 for (const auto &album : scope.store->queryAlbums(query.query_string(), MAX_RESULTS)) {
160 CategorisedResult res(cat);162 CategorisedResult res(cat);
161 res.set_uri("album:///" + uriencode(album.getArtist()) + "/" +163 res.set_uri("album:///" + uriencode(album.getArtist()) + "/" +
@@ -237,7 +239,7 @@
237 VariantBuilder builder;239 VariantBuilder builder;
238 builder.add_tuple({240 builder.add_tuple({
239 {"id", Variant("play")},241 {"id", Variant("play")},
240 {"label", Variant("Play in music app")}242 {"label", Variant(_("Play in music app"))}
241 });243 });
242 actions.add_attribute_value("actions", builder.end());244 actions.add_attribute_value("actions", builder.end());
243 }245 }
@@ -274,7 +276,7 @@
274 VariantBuilder builder;276 VariantBuilder builder;
275 builder.add_tuple({277 builder.add_tuple({
276 {"uri", Variant(result.uri())},278 {"uri", Variant(result.uri())},
277 {"label", Variant("Play in music app")}279 {"label", Variant(_("Play in music app"))}
278 });280 });
279 actions.add_attribute_value("actions", builder.end());281 actions.add_attribute_value("actions", builder.end());
280 }282 }
281283
=== modified file 'src/musicaggregatorscope.cpp'
--- src/musicaggregatorscope.cpp 2014-03-19 13:59:25 +0000
+++ src/musicaggregatorscope.cpp 2014-04-30 09:50:48 +0000
@@ -30,6 +30,7 @@
30const char *ONLINESCOPE = "com.canonical.scopes.grooveshark";30const char *ONLINESCOPE = "com.canonical.scopes.grooveshark";
3131
32int MusicAggregatorScope::start(std::string const&, unity::scopes::RegistryProxy const& registry) {32int MusicAggregatorScope::start(std::string const&, unity::scopes::RegistryProxy const& registry) {
33 setlocale(LC_ALL, "");
33 this->registry = registry;34 this->registry = registry;
34 CategoryRenderer basic;35 CategoryRenderer basic;
35 local_scope = registry->get_metadata(LOCALSCOPE).proxy();36 local_scope = registry->get_metadata(LOCALSCOPE).proxy();
3637
=== modified file 'src/video-scope.cpp'
--- src/video-scope.cpp 2014-03-12 17:11:31 +0000
+++ src/video-scope.cpp 2014-04-30 09:50:48 +0000
@@ -27,6 +27,7 @@
27#include <unity/scopes/VariantBuilder.h>27#include <unity/scopes/VariantBuilder.h>
2828
29#include "video-scope.h"29#include "video-scope.h"
30#include "i18n.h"
3031
31#define MAX_RESULTS 10032#define MAX_RESULTS 100
3233
@@ -69,6 +70,7 @@
69)";70)";
7071
71int VideoScope::start(std::string const&, RegistryProxy const&) {72int VideoScope::start(std::string const&, RegistryProxy const&) {
73 setlocale(LC_ALL, "");
72 store.reset(new MediaStore(MS_READ_ONLY));74 store.reset(new MediaStore(MS_READ_ONLY));
73 return VERSION;75 return VERSION;
74}76}
@@ -98,7 +100,7 @@
98100
99void VideoQuery::run(SearchReplyProxy const&reply) {101void VideoQuery::run(SearchReplyProxy const&reply) {
100 CategoryRenderer renderer(query.query_string() == "" ? LOCAL_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);102 CategoryRenderer renderer(query.query_string() == "" ? LOCAL_CATEGORY_DEFINITION : SEARCH_CATEGORY_DEFINITION);
101 auto cat = reply->register_category("local", "My Videos", LOCAL_CATEGORY_ICON, renderer);103 auto cat = reply->register_category("local", _("My Videos"), LOCAL_CATEGORY_ICON, renderer);
102 for (const auto &media : scope.store->query(query.query_string(), VideoMedia, MAX_RESULTS)) {104 for (const auto &media : scope.store->query(query.query_string(), VideoMedia, MAX_RESULTS)) {
103 CategorisedResult res(cat);105 CategorisedResult res(cat);
104 res.set_uri(media.getUri());106 res.set_uri(media.getUri());
@@ -147,7 +149,7 @@
147 VariantBuilder builder;149 VariantBuilder builder;
148 builder.add_tuple({150 builder.add_tuple({
149 {"id", Variant("play")},151 {"id", Variant("play")},
150 {"label", Variant("Play")}152 {"label", Variant(_("Play"))}
151 });153 });
152 actions.add_attribute_value("actions", builder.end());154 actions.add_attribute_value("actions", builder.end());
153 }155 }
154156
=== modified file 'src/videoaggregatorscope.cpp'
--- src/videoaggregatorscope.cpp 2014-03-19 13:59:25 +0000
+++ src/videoaggregatorscope.cpp 2014-04-30 09:50:48 +0000
@@ -30,6 +30,7 @@
30const char *ONLINESCOPE = "com.canonical.scopes.remotevideos";30const char *ONLINESCOPE = "com.canonical.scopes.remotevideos";
3131
32int VideoAggregatorScope::start(std::string const&, unity::scopes::RegistryProxy const& registry) {32int VideoAggregatorScope::start(std::string const&, unity::scopes::RegistryProxy const& registry) {
33 setlocale(LC_ALL, "");
33 this->registry = registry;34 this->registry = registry;
34 CategoryRenderer basic;35 CategoryRenderer basic;
35 local_scope = registry->get_metadata(LOCALSCOPE).proxy();36 local_scope = registry->get_metadata(LOCALSCOPE).proxy();

Subscribers

People subscribed via source and target branches

to all changes: