Merge lp:~gordallott/unity/fix-hud-translation into lp:unity

Proposed by Gord Allott
Status: Merged
Approved by: Michal Hruby
Approved revision: no longer in the source branch.
Merged at revision: 2224
Proposed branch: lp:~gordallott/unity/fix-hud-translation
Merge into: lp:unity
Diff against target: 63 lines (+6/-7)
1 file modified
plugins/unityshell/src/HudView.cpp (+6/-7)
To merge this branch: bzr merge lp:~gordallott/unity/fix-hud-translation
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+100937@code.launchpad.net

Commit message

Fixes a hud translation issue, can't have const std::strings in an anonymous namespace.

Description of the change

Fixes a hud translation issue, can't have const std::strings in an anonymous namespace. no tests - for obvious reasons

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/HudView.cpp'
2--- plugins/unityshell/src/HudView.cpp 2012-04-01 00:45:53 +0000
3+++ plugins/unityshell/src/HudView.cpp 2012-04-05 09:15:23 +0000
4@@ -40,7 +40,6 @@
5 {
6 nux::logging::Logger logger("unity.hud.view");
7 const int icon_size = 46;
8-const std::string default_text = _("Type your command");
9 const int grow_anim_length = 90 * 1000;
10 const int pause_before_grow_length = 32 * 1000;
11
12@@ -176,7 +175,7 @@
13 void View::ResetToDefault()
14 {
15 search_bar_->search_string = "";
16- search_bar_->search_hint = default_text;
17+ search_bar_->search_hint = _("Type your command");
18 }
19
20 void View::Relayout()
21@@ -361,7 +360,7 @@
22 search_bar_ = new unity::SearchBar(true);
23 search_bar_->SetMinimumHeight(style.GetSearchBarHeight());
24 search_bar_->SetMaximumHeight(style.GetSearchBarHeight());
25- search_bar_->search_hint = default_text;
26+ search_bar_->search_hint = _("Type your command");
27 search_bar_->search_changed.connect(sigc::mem_fun(this, &View::OnSearchChanged));
28 AddChild(search_bar_.GetPointer());
29 content_layout_->AddView(search_bar_.GetPointer(), 0, nux::MINOR_POSITION_LEFT);
30@@ -385,7 +384,7 @@
31 search_changed.emit(search_string);
32 if (search_string.empty())
33 {
34- search_bar_->search_hint = default_text;
35+ search_bar_->search_hint = _("Type your command");
36 }
37 else
38 {
39@@ -493,7 +492,7 @@
40 else
41 {
42 search_bar_->search_string = "";
43- search_bar_->search_hint = default_text;
44+ search_bar_->search_hint = _("Type your command");
45 }
46 return true;
47 }
48@@ -544,13 +543,13 @@
49
50 if (search_bar_->search_string == "")
51 {
52- search_bar_->search_hint = default_text;
53+ search_bar_->search_hint = _("Type your command");
54 ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST);
55 }
56 else
57 {
58 search_bar_->search_string = "";
59- search_bar_->search_hint = default_text;
60+ search_bar_->search_hint = _("Type your command");
61 return search_bar_->text_entry();
62 }
63 return NULL;