Merge lp:~dobey/unity-scope-click/plural-results into lp:unity-scope-click/devel

Proposed by dobey
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 351
Merged at revision: 351
Proposed branch: lp:~dobey/unity-scope-click/plural-results
Merge into: lp:unity-scope-click/devel
Diff against target: 105 lines (+22/-14)
3 files modified
po/unity-scope-click.pot (+14/-11)
scope/clickstore/store-query.cpp (+6/-1)
scope/tests/test_query.cpp (+2/-2)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/plural-results
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+227633@code.launchpad.net

Commit message

Use dngettext to have the results string be pluralized.

To post a comment you must log in.
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Why do you need to remove the checks with CategoryHasNumberOfResults?

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
dobey (dobey) wrote :

On Mon, 2014-07-21 at 21:49 +0000, Alejandro J. Cura wrote:
> Review: Needs Information
>
> Why do you need to remove the checks with CategoryHasNumberOfResults?

I removed them from the two tests for testing the Purchased flag,
because those tests should not be testing the category results string,
but only data related to purchasing. I should have done this in the
branch that added those tests, but didn't notice it until I broke the
tests when creating this branch. So I removed them here.

Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/unity-scope-click.pot'
--- po/unity-scope-click.pot 2014-07-18 13:35:58 +0000
+++ po/unity-scope-click.pot 2014-07-21 20:51:07 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-07-18 09:34-0400\n"11"POT-Creation-Date: 2014-07-21 16:42-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"
@@ -16,6 +16,7 @@
16"MIME-Version: 1.0\n"16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=UTF-8\n"17"Content-Type: text/plain; charset=UTF-8\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
1920
20#: ../data/com.canonical.scopes.clickstore.ini.in.in.h:121#: ../data/com.canonical.scopes.clickstore.ini.in.in.h:1
21#: ../scope/clickapps/apps-query.cpp:25822#: ../scope/clickapps/apps-query.cpp:258
@@ -105,32 +106,34 @@
105msgstr ""106msgstr ""
106107
107#: ../scope/clickapps/apps-query.cpp:297108#: ../scope/clickapps/apps-query.cpp:297
108#: ../scope/clickstore/store-query.cpp:234109#: ../scope/clickstore/store-query.cpp:236
109#: ../scope/clickstore/store-query.cpp:245110#: ../scope/clickstore/store-query.cpp:247
110msgid "All departments"111msgid "All departments"
111msgstr ""112msgstr ""
112113
113#: ../scope/clickstore/store-query.cpp:283114#: ../scope/clickstore/store-query.cpp:285
114msgid "✔ INSTALLED"115msgid "✔ INSTALLED"
115msgstr ""116msgstr ""
116117
117#: ../scope/clickstore/store-query.cpp:288118#: ../scope/clickstore/store-query.cpp:290
118msgid "✔ PURCHASED"119msgid "✔ PURCHASED"
119msgstr ""120msgstr ""
120121
121#: ../scope/clickstore/store-query.cpp:292122#: ../scope/clickstore/store-query.cpp:298
122msgid "FREE"123msgid "FREE"
123msgstr ""124msgstr ""
124125
125#: ../scope/clickstore/store-query.cpp:401126#: ../scope/clickstore/store-query.cpp:408
126msgid "Available"127msgid "Available"
127msgstr ""128msgstr ""
128129
129#: ../scope/clickstore/store-query.cpp:404130#: ../scope/clickstore/store-query.cpp:414
130#, c-format131#, c-format
131msgid "%u results in Ubuntu Store"132msgid "%u result in Ubuntu Store"
132msgstr ""133msgid_plural "%u results in Ubuntu Store"
134msgstr[0] ""
135msgstr[1] ""
133136
134#: ../scope/clickstore/store-query.cpp:412137#: ../scope/clickstore/store-query.cpp:424
135msgid "Recommended"138msgid "Recommended"
136msgstr ""139msgstr ""
137140
=== modified file 'scope/clickstore/store-query.cpp'
--- scope/clickstore/store-query.cpp 2014-07-17 21:35:57 +0000
+++ scope/clickstore/store-query.cpp 2014-07-21 20:51:07 +0000
@@ -408,7 +408,12 @@
408 std::string cat_title(_("Available"));408 std::string cat_title(_("Available"));
409 {409 {
410 char tmp[512];410 char tmp[512];
411 if (snprintf(tmp, sizeof(tmp), _("%u results in Ubuntu Store"), static_cast<unsigned int>(packages.size())) > 0) {411 unsigned int num_results = static_cast<unsigned int>(packages.size());
412 if (snprintf(tmp, sizeof(tmp),
413 dngettext(GETTEXT_PACKAGE,
414 "%u result in Ubuntu Store",
415 "%u results in Ubuntu Store",
416 num_results), num_results) > 0) {
412 cat_title = tmp;417 cat_title = tmp;
413 }418 }
414 }419 }
415420
=== modified file 'scope/tests/test_query.cpp'
--- scope/tests/test_query.cpp 2014-07-18 15:01:41 +0000
+++ scope/tests/test_query.cpp 2014-07-21 20:51:07 +0000
@@ -408,7 +408,7 @@
408 auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);408 auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
409409
410 ON_CALL(q, register_category(_, _, _, _, _)).WillByDefault(Return(ptrCat));410 ON_CALL(q, register_category(_, _, _, _, _)).WillByDefault(Return(ptrCat));
411 EXPECT_CALL(q, register_category(_, "appstore", CategoryHasNumberOfResults(1), _, _));411 EXPECT_CALL(q, register_category(_, "appstore", _, _, _));
412 EXPECT_CALL(q, register_category(_, "recommends", _, _, _));412 EXPECT_CALL(q, register_category(_, "recommends", _, _, _));
413413
414 scopes::testing::MockSearchReply mock_reply;414 scopes::testing::MockSearchReply mock_reply;
@@ -443,7 +443,7 @@
443 auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);443 auto ptrCat = std::make_shared<FakeCategory>("id", "", "", renderer);
444444
445 ON_CALL(q, register_category(_, _, _, _, _)).WillByDefault(Return(ptrCat));445 ON_CALL(q, register_category(_, _, _, _, _)).WillByDefault(Return(ptrCat));
446 EXPECT_CALL(q, register_category(_, "appstore", CategoryHasNumberOfResults(1), _, _));446 EXPECT_CALL(q, register_category(_, "appstore", _, _, _));
447 EXPECT_CALL(q, register_category(_, "recommends", _, _, _));447 EXPECT_CALL(q, register_category(_, "recommends", _, _, _));
448448
449 scopes::testing::MockSearchReply mock_reply;449 scopes::testing::MockSearchReply mock_reply;

Subscribers

People subscribed via source and target branches

to all changes: