diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 394f9b666..e704950f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1492,14 +1492,14 @@ module ApplicationHelper html.html_safe end - def delete_link(url, options={}) + def delete_link(url, options={}, button_name=l(:button_delete)) options = { :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del' }.merge(options) - link_to l(:button_delete), url, options + link_to button_name, url, options end def link_to_function(name, function, html_options={}) diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb index 93cd12a2a..cf870116f 100644 --- a/app/views/calendars/show.html.erb +++ b/app/views/calendars/show.html.erb @@ -28,13 +28,13 @@ <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save), + <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), "$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();", :class => 'icon icon-save' %> <% end %> <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query, :calendar => 1), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query, :calendar => 1) %> + <%= link_to l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query, :calendar => 1), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query, :calendar => 1), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %>

diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb index 1321acdd8..9082d0375 100644 --- a/app/views/gantts/show.html.erb +++ b/app/views/gantts/show.html.erb @@ -91,13 +91,13 @@ <%= link_to l(:button_clear), { :project_id => @project, :set_filter => 1 }, :class => 'icon icon-reload' %> <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save), + <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), "$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit();", :class => 'icon icon-save' %> <% end %> <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query, :gantt => 1) %> + <%= link_to l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query, :gantt => 1), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query, :gantt => 1), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %>

diff --git a/app/views/queries/_query_form.html.erb b/app/views/queries/_query_form.html.erb index bb29827f8..734e96d7b 100644 --- a/app/views/queries/_query_form.html.erb +++ b/app/views/queries/_query_form.html.erb @@ -57,14 +57,14 @@ <%= link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %> <% if @query.new_record? %> <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save), + <%= link_to_function l(:button_save_object, object_name: l(:label_query).downcase), "$('#query_type').prop('disabled',false);$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", :class => 'icon icon-save' %> <% end %> <% else %> <% if @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query) %> + <%= link_to l(:button_edit_object, object_name: l(:label_query).downcase), edit_query_path(@query), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query), {}, l(:button_delete_object, object_name: l(:label_query).downcase) %> <% end %> <% end %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 142afa001..6d45722dc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1161,6 +1161,9 @@ en: button_filter: Filter button_actions: Actions button_add_subtask: Add subtask + button_save_object: "Save %{object_name}" + button_edit_object: "Edit %{object_name}" + button_delete_object: "Delete %{object_name}" status_active: active status_registered: registered diff --git a/config/locales/ja.yml b/config/locales/ja.yml index db52188dc..ff6953c84 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -868,6 +868,9 @@ ja: button_configure: 設定 button_quote: 引用 button_show: 表示 + button_save_object: "%{object_name}を保存" + button_edit_object: "%{object_name}を編集" + button_delete_object: "%{object_name}を削除" status_active: 有効 status_registered: 登録