Index: app/models/wiki.rb
<+>UTF-8
===================================================================
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
--- a/app/models/wiki.rb (revision 41374:587bd15c0af7d26ff2c63f451efe473b200590e2)
+++ b/app/models/wiki.rb (revision 41374+:587bd15c0af7+)
@@ -40,7 +40,7 @@
# Returns the wiki page that acts as the sidebar content
# or nil if no such page exists
def sidebar
- @sidebar ||= find_page('Sidebar', :with_redirect => false)
+ @sidebar ||= find_page(l(:label_wiki_sidebar), :with_redirect => false)
end
# find the page with the given title
Index: app/views/wiki/_sidebar.html.erb
<+>UTF-8
===================================================================
diff --git a/app/views/wiki/_sidebar.html.erb b/app/views/wiki/_sidebar.html.erb
--- a/app/views/wiki/_sidebar.html.erb (revision 41374:587bd15c0af7d26ff2c63f451efe473b200590e2)
+++ b/app/views/wiki/_sidebar.html.erb (revision 41374+:587bd15c0af7+)
@@ -1,7 +1,7 @@
<% if User.current.allowed_to?(:edit_wiki_pages, @project) &&
- (@wiki && @wiki.find_or_new_page('Sidebar').editable_by?(User.current)) %>
+ (@wiki && @wiki.find_or_new_page(l(:label_wiki_sidebar)).editable_by?(User.current)) %>
- <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, 'sidebar'),
+ <%= link_to l(:button_edit), edit_project_wiki_page_path(@project, l(:label_wiki_sidebar)),
:class => 'icon icon-edit' %>
<% end -%>
Index: config/locales/en.yml
<+>UTF-8
===================================================================
diff --git a/config/locales/en.yml b/config/locales/en.yml
--- a/config/locales/en.yml (revision 41374:587bd15c0af7d26ff2c63f451efe473b200590e2)
+++ b/config/locales/en.yml (revision 41374+:587bd15c0af7+)
@@ -967,6 +967,7 @@
label_days_to_html: "%{days} days up to %{date}"
label_wiki_content_added: Wiki page added
label_wiki_content_updated: Wiki page updated
+ label_wiki_sidebar: Sidebar
label_group: Group
label_group_plural: Groups
label_group_new: New group
Index: config/locales/fa.yml
<+>UTF-8
===================================================================
diff --git a/config/locales/fa.yml b/config/locales/fa.yml
--- a/config/locales/fa.yml (revision 41374:587bd15c0af7d26ff2c63f451efe473b200590e2)
+++ b/config/locales/fa.yml (revision 41374+:587bd15c0af7+)
@@ -903,6 +903,7 @@
label_date_from_to: از %{start} تا %{end}
label_wiki_content_added: صفحه دانشنامه افزوده شد
label_wiki_content_updated: صفحه دانشنامه بهروز شد
+ label_wiki_sidebar: کناره
label_group: گروه
label_group_plural: گروهها
label_group_new: گروه جدید
Index: test/functional/wiki_controller_test.rb
<+>UTF-8
===================================================================
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
--- a/test/functional/wiki_controller_test.rb (revision 41374:587bd15c0af7d26ff2c63f451efe473b200590e2)
+++ b/test/functional/wiki_controller_test.rb (revision 41374+:587bd15c0af7+)
@@ -112,7 +112,7 @@
end
def test_show_with_sidebar
- page = Project.find(1).wiki.pages.new(:title => 'Sidebar')
+ page = Project.find(1).wiki.pages.new(:title => I18n.l(:label_wiki_sidebar))
page.content = WikiContent.new(:text => 'Side bar content for test_show_with_sidebar')
page.save!
@@ -250,7 +250,7 @@
Role.find(1).remove_permission!(:protect_wiki_pages)
@request.session[:user_id] = 2
- post :new, :params => {:project_id => 'ecookbook', :title => 'Sidebar'}
+ post :new, :params => {:project_id => 'ecookbook', :title => I18n.l(:label_wiki_sidebar)}
assert_response :success
assert_select_error /Title/
end
Index: test/unit/wiki_test.rb
<+>UTF-8
===================================================================
diff --git a/test/unit/wiki_test.rb b/test/unit/wiki_test.rb
--- a/test/unit/wiki_test.rb (revision 41374:587bd15c0af7d26ff2c63f451efe473b200590e2)
+++ b/test/unit/wiki_test.rb (revision 41374+:587bd15c0af7+)
@@ -104,12 +104,12 @@
def test_sidebar_should_return_a_wiki_page_if_defined
@wiki = Wiki.find(1)
- page = @wiki.pages.new(:title => 'Sidebar')
+ page = @wiki.pages.new(:title => I18n.l(:label_wiki_sidebar))
page.content = WikiContent.new(:text => 'Side bar content for test_show_with_sidebar')
page.save!
assert_kind_of WikiPage, @wiki.sidebar
- assert_equal 'Sidebar', @wiki.sidebar.title
+ assert_equal I18n.l(:label_wiki_sidebar), @wiki.sidebar.title
end
def test_destroy_should_remove_redirects_from_the_wiki