Merge lp:~bregma/unity/lp-1106849 into lp:unity

Proposed by Stephen M. Webb
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3217
Proposed branch: lp:~bregma/unity/lp-1106849
Merge into: lp:unity
Diff against target: 55 lines (+11/-2)
2 files modified
tests/autopilot/unity/tests/test_dash.py (+6/-0)
unity-shared/CoverArt.cpp (+5/-2)
To merge this branch: bzr merge lp:~bregma/unity/lp-1106849
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer (community) Approve
Review via email: mp+153432@code.launchpad.net

Commit message

Internationalized ‘No Image Available’ in Dash Previews (lp: #1106849).

Description of the change

= Problem description =

Placeholder string in Previews was not internationalized.

= The fix =

Internationalized the placeholder string.

= Test coverage =

Added AP test unity.tests.test_dash.PreviewMavigateTests.test_overlay_text to ensure there is no regression (l10n tests are not yet available in autopilot).

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Pfft no space left? Make some!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/unity/tests/test_dash.py'
2--- tests/autopilot/unity/tests/test_dash.py 2013-02-28 11:46:58 +0000
3+++ tests/autopilot/unity/tests/test_dash.py 2013-03-14 18:12:26 +0000
4@@ -972,6 +972,12 @@
5
6 self.assertThat(self.unity.dash.preview_displaying, Eventually(Equals(False)))
7
8+ def test_overlay_text(self):
9+ """Fallback overlay text is internationalized, should always be valid."""
10+ cover_art = self.get_current_preview().cover_art[0]
11+ self.assertThat(cover_art.overlay_text,
12+ Eventually(Equals("No Image Available")))
13+
14
15 class PreviewClickCancelTests(DashTestCase):
16 """Tests that the preview closes when left, middle, and right clicking in the preview"""
17
18=== modified file 'unity-shared/CoverArt.cpp'
19--- unity-shared/CoverArt.cpp 2012-12-17 21:30:27 +0000
20+++ unity-shared/CoverArt.cpp 2013-03-14 18:12:26 +0000
21@@ -20,6 +20,7 @@
22 * Nick Dedekind <nick.dedekind@canonical.com>
23 *
24 */
25+#include "config.h"
26
27 #include "CoverArt.h"
28 #include "unity-shared/IntrospectableWrappers.h"
29@@ -29,6 +30,7 @@
30 #include "DashStyle.h"
31 #include "IconLoader.h"
32 #include "PreviewStyle.h"
33+#include <glib/gi18n-lib.h>
34
35 namespace unity
36 {
37@@ -83,7 +85,8 @@
38 variant::BuilderWrapper(builder)
39 .add(GetAbsoluteGeometry())
40 .add("image-hint", image_hint_)
41- .add("waiting", waiting_);
42+ .add("waiting", waiting_)
43+ .add("overlay-text", overlay_text_->GetText());
44 }
45
46 void CoverArt::SetImage(std::string const& image_hint)
47@@ -446,7 +449,7 @@
48 overlay_text_->SetTextAlignment(StaticCairoText::NUX_ALIGN_CENTRE);
49 overlay_text_->SetFont("Ubuntu 14");
50 overlay_text_->SetLines(-3);
51- overlay_text_->SetText("No Image Available");
52+ overlay_text_->SetText(_("No Image Available"));
53
54 dash::Style& style = dash::Style::Instance();
55 spin_ = style.GetSearchSpinIcon();