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
=== modified file 'tests/autopilot/unity/tests/test_dash.py'
--- tests/autopilot/unity/tests/test_dash.py 2013-02-28 11:46:58 +0000
+++ tests/autopilot/unity/tests/test_dash.py 2013-03-14 18:12:26 +0000
@@ -972,6 +972,12 @@
972972
973 self.assertThat(self.unity.dash.preview_displaying, Eventually(Equals(False)))973 self.assertThat(self.unity.dash.preview_displaying, Eventually(Equals(False)))
974974
975 def test_overlay_text(self):
976 """Fallback overlay text is internationalized, should always be valid."""
977 cover_art = self.get_current_preview().cover_art[0]
978 self.assertThat(cover_art.overlay_text,
979 Eventually(Equals("No Image Available")))
980
975981
976class PreviewClickCancelTests(DashTestCase):982class PreviewClickCancelTests(DashTestCase):
977 """Tests that the preview closes when left, middle, and right clicking in the preview"""983 """Tests that the preview closes when left, middle, and right clicking in the preview"""
978984
=== modified file 'unity-shared/CoverArt.cpp'
--- unity-shared/CoverArt.cpp 2012-12-17 21:30:27 +0000
+++ unity-shared/CoverArt.cpp 2013-03-14 18:12:26 +0000
@@ -20,6 +20,7 @@
20 * Nick Dedekind <nick.dedekind@canonical.com>20 * Nick Dedekind <nick.dedekind@canonical.com>
21 *21 *
22 */22 */
23#include "config.h"
2324
24#include "CoverArt.h"25#include "CoverArt.h"
25#include "unity-shared/IntrospectableWrappers.h"26#include "unity-shared/IntrospectableWrappers.h"
@@ -29,6 +30,7 @@
29#include "DashStyle.h"30#include "DashStyle.h"
30#include "IconLoader.h"31#include "IconLoader.h"
31#include "PreviewStyle.h"32#include "PreviewStyle.h"
33#include <glib/gi18n-lib.h>
3234
33namespace unity35namespace unity
34{36{
@@ -83,7 +85,8 @@
83 variant::BuilderWrapper(builder)85 variant::BuilderWrapper(builder)
84 .add(GetAbsoluteGeometry())86 .add(GetAbsoluteGeometry())
85 .add("image-hint", image_hint_)87 .add("image-hint", image_hint_)
86 .add("waiting", waiting_);88 .add("waiting", waiting_)
89 .add("overlay-text", overlay_text_->GetText());
87}90}
8891
89void CoverArt::SetImage(std::string const& image_hint)92void CoverArt::SetImage(std::string const& image_hint)
@@ -446,7 +449,7 @@
446 overlay_text_->SetTextAlignment(StaticCairoText::NUX_ALIGN_CENTRE);449 overlay_text_->SetTextAlignment(StaticCairoText::NUX_ALIGN_CENTRE);
447 overlay_text_->SetFont("Ubuntu 14");450 overlay_text_->SetFont("Ubuntu 14");
448 overlay_text_->SetLines(-3);451 overlay_text_->SetLines(-3);
449 overlay_text_->SetText("No Image Available");452 overlay_text_->SetText(_("No Image Available"));
450453
451 dash::Style& style = dash::Style::Instance();454 dash::Style& style = dash::Style::Instance();
452 spin_ = style.GetSearchSpinIcon();455 spin_ = style.GetSearchSpinIcon();