Merge lp:~alecu/unity-scope-click/fix-static-translations into lp:unity-scope-click/devel

Proposed by Alejandro J. Cura
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 411
Merged at revision: 413
Proposed branch: lp:~alecu/unity-scope-click/fix-static-translations
Merge into: lp:unity-scope-click/devel
Diff against target: 75 lines (+6/-13)
3 files modified
libclickscope/click/preview.cpp (+3/-7)
libclickscope/click/preview.h (+0/-3)
libclickscope/tests/test_preview.cpp (+3/-3)
To merge this branch: bzr merge lp:~alecu/unity-scope-click/fix-static-translations
Reviewer Review Type Date Requested Status
Diego Sarmentero (community) Approve
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+231461@code.launchpad.net

Commit message

Do not use static const strings for translations.

To post a comment you must log in.
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 :

Makes sense, +1.

review: Approve
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libclickscope/click/preview.cpp'
--- libclickscope/click/preview.cpp 2014-08-13 14:43:32 +0000
+++ libclickscope/click/preview.cpp 2014-08-19 21:47:21 +0000
@@ -55,10 +55,6 @@
5555
56namespace click {56namespace click {
5757
58const std::string PreviewStrategy::INFO_LABEL = _("Info");
59const std::string PreviewStrategy::UPDATES_LABEL = _("Updates");
60const std::string PreviewStrategy::WHATS_NEW_LABEL = _("What's new");
61
62DepartmentUpdater::DepartmentUpdater(const std::shared_ptr<click::DepartmentsDb>& depts)58DepartmentUpdater::DepartmentUpdater(const std::shared_ptr<click::DepartmentsDb>& depts)
63 : depts(depts)59 : depts(depts)
64{60{
@@ -349,7 +345,7 @@
349 if (!details.description.empty())345 if (!details.description.empty())
350 {346 {
351 scopes::PreviewWidget summary("summary", "text");347 scopes::PreviewWidget summary("summary", "text");
352 summary.add_attribute_value("title", scopes::Variant(INFO_LABEL));348 summary.add_attribute_value("title", scopes::Variant(_("Info")));
353 summary.add_attribute_value("text", scopes::Variant(details.description));349 summary.add_attribute_value("text", scopes::Variant(details.description));
354 widgets.push_back(summary);350 widgets.push_back(summary);
355 }351 }
@@ -359,12 +355,12 @@
359 widgets.push_back(other_metadata);355 widgets.push_back(other_metadata);
360356
361 scopes::PreviewWidget updates("updates", "text");357 scopes::PreviewWidget updates("updates", "text");
362 updates.add_attribute_value("title", scopes::Variant(UPDATES_LABEL));358 updates.add_attribute_value("title", scopes::Variant(_("Updates")));
363 updates.add_attribute_value("text", scopes::Variant(build_updates_table(details)));359 updates.add_attribute_value("text", scopes::Variant(build_updates_table(details)));
364 widgets.push_back(updates);360 widgets.push_back(updates);
365361
366 scopes::PreviewWidget whats_new("whats_new", "text");362 scopes::PreviewWidget whats_new("whats_new", "text");
367 whats_new.add_attribute_value("title", scopes::Variant(WHATS_NEW_LABEL));363 whats_new.add_attribute_value("title", scopes::Variant(_("What's new")));
368 whats_new.add_attribute_value("text", scopes::Variant(build_whats_new(details)));364 whats_new.add_attribute_value("text", scopes::Variant(build_whats_new(details)));
369 widgets.push_back(whats_new);365 widgets.push_back(whats_new);
370366
371367
=== modified file 'libclickscope/click/preview.h'
--- libclickscope/click/preview.h 2014-08-13 14:43:32 +0000
+++ libclickscope/click/preview.h 2014-08-19 21:47:21 +0000
@@ -126,9 +126,6 @@
126126
127 virtual void cancelled();127 virtual void cancelled();
128 virtual void run(unity::scopes::PreviewReplyProxy const& reply) = 0;128 virtual void run(unity::scopes::PreviewReplyProxy const& reply) = 0;
129 static const std::string INFO_LABEL;
130 static const std::string UPDATES_LABEL;
131 static const std::string WHATS_NEW_LABEL;
132protected:129protected:
133 virtual void populateDetails(std::function<void(const PackageDetails &)> details_callback,130 virtual void populateDetails(std::function<void(const PackageDetails &)> details_callback,
134 std::function<void(const click::ReviewList&,131 std::function<void(const click::ReviewList&,
135132
=== modified file 'libclickscope/tests/test_preview.cpp'
--- libclickscope/tests/test_preview.cpp 2014-08-13 14:43:32 +0000
+++ libclickscope/tests/test_preview.cpp 2014-08-19 21:47:21 +0000
@@ -127,15 +127,15 @@
127127
128TEST_F(PreviewStrategyDescriptionTest, testDescriptionWidgets)128TEST_F(PreviewStrategyDescriptionTest, testDescriptionWidgets)
129{129{
130 assertWidgetAttribute(0, "title", click::PreviewStrategy::INFO_LABEL);130 assertWidgetAttribute(0, "title", "Info");
131 assertWidgetAttribute(0, "text", details.description);131 assertWidgetAttribute(0, "text", details.description);
132132
133 assertWidgetAttribute(1, "text", preview.build_other_metadata(details));133 assertWidgetAttribute(1, "text", preview.build_other_metadata(details));
134134
135 assertWidgetAttribute(2, "title", click::PreviewStrategy::UPDATES_LABEL);135 assertWidgetAttribute(2, "title", "Updates");
136 assertWidgetAttribute(2, "text", preview.build_updates_table(details));136 assertWidgetAttribute(2, "text", preview.build_updates_table(details));
137137
138 assertWidgetAttribute(3, "title", click::PreviewStrategy::WHATS_NEW_LABEL);138 assertWidgetAttribute(3, "title", "What's new");
139 assertWidgetAttribute(3, "text", preview.build_whats_new(details));139 assertWidgetAttribute(3, "text", preview.build_whats_new(details));
140140
141}141}

Subscribers

People subscribed via source and target branches

to all changes: