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
1=== modified file 'libclickscope/click/preview.cpp'
2--- libclickscope/click/preview.cpp 2014-08-13 14:43:32 +0000
3+++ libclickscope/click/preview.cpp 2014-08-19 21:47:21 +0000
4@@ -55,10 +55,6 @@
5
6 namespace click {
7
8-const std::string PreviewStrategy::INFO_LABEL = _("Info");
9-const std::string PreviewStrategy::UPDATES_LABEL = _("Updates");
10-const std::string PreviewStrategy::WHATS_NEW_LABEL = _("What's new");
11-
12 DepartmentUpdater::DepartmentUpdater(const std::shared_ptr<click::DepartmentsDb>& depts)
13 : depts(depts)
14 {
15@@ -349,7 +345,7 @@
16 if (!details.description.empty())
17 {
18 scopes::PreviewWidget summary("summary", "text");
19- summary.add_attribute_value("title", scopes::Variant(INFO_LABEL));
20+ summary.add_attribute_value("title", scopes::Variant(_("Info")));
21 summary.add_attribute_value("text", scopes::Variant(details.description));
22 widgets.push_back(summary);
23 }
24@@ -359,12 +355,12 @@
25 widgets.push_back(other_metadata);
26
27 scopes::PreviewWidget updates("updates", "text");
28- updates.add_attribute_value("title", scopes::Variant(UPDATES_LABEL));
29+ updates.add_attribute_value("title", scopes::Variant(_("Updates")));
30 updates.add_attribute_value("text", scopes::Variant(build_updates_table(details)));
31 widgets.push_back(updates);
32
33 scopes::PreviewWidget whats_new("whats_new", "text");
34- whats_new.add_attribute_value("title", scopes::Variant(WHATS_NEW_LABEL));
35+ whats_new.add_attribute_value("title", scopes::Variant(_("What's new")));
36 whats_new.add_attribute_value("text", scopes::Variant(build_whats_new(details)));
37 widgets.push_back(whats_new);
38
39
40=== modified file 'libclickscope/click/preview.h'
41--- libclickscope/click/preview.h 2014-08-13 14:43:32 +0000
42+++ libclickscope/click/preview.h 2014-08-19 21:47:21 +0000
43@@ -126,9 +126,6 @@
44
45 virtual void cancelled();
46 virtual void run(unity::scopes::PreviewReplyProxy const& reply) = 0;
47- static const std::string INFO_LABEL;
48- static const std::string UPDATES_LABEL;
49- static const std::string WHATS_NEW_LABEL;
50 protected:
51 virtual void populateDetails(std::function<void(const PackageDetails &)> details_callback,
52 std::function<void(const click::ReviewList&,
53
54=== modified file 'libclickscope/tests/test_preview.cpp'
55--- libclickscope/tests/test_preview.cpp 2014-08-13 14:43:32 +0000
56+++ libclickscope/tests/test_preview.cpp 2014-08-19 21:47:21 +0000
57@@ -127,15 +127,15 @@
58
59 TEST_F(PreviewStrategyDescriptionTest, testDescriptionWidgets)
60 {
61- assertWidgetAttribute(0, "title", click::PreviewStrategy::INFO_LABEL);
62+ assertWidgetAttribute(0, "title", "Info");
63 assertWidgetAttribute(0, "text", details.description);
64
65 assertWidgetAttribute(1, "text", preview.build_other_metadata(details));
66
67- assertWidgetAttribute(2, "title", click::PreviewStrategy::UPDATES_LABEL);
68+ assertWidgetAttribute(2, "title", "Updates");
69 assertWidgetAttribute(2, "text", preview.build_updates_table(details));
70
71- assertWidgetAttribute(3, "title", click::PreviewStrategy::WHATS_NEW_LABEL);
72+ assertWidgetAttribute(3, "title", "What's new");
73 assertWidgetAttribute(3, "text", preview.build_whats_new(details));
74
75 }

Subscribers

People subscribed via source and target branches

to all changes: