From: Tom Hughes Date: Wed, 12 Jun 2019 18:50:52 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/2257' X-Git-Tag: live~2534 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d9b8ebeb01e6cf81f6d9ea70748fedb14e4d86fa?hp=24b138db094e4b5e8d062c5248ee867967dc0fd7 Merge remote-tracking branch 'upstream/pull/2257' --- diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index a56613b49..cc761b15d 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -19,9 +19,9 @@ <%= error_messages_for "diary_comment" %> - <%= form_for :diary_comment, :url => { :action => "comment" } do |f| %> + <%= form_for @entry.comments.new, :url => { :action => "comment" } do |f| %> <%= richtext_area :diary_comment, :body, :cols => 80, :rows => 15 %> - <%= submit_tag t(".save_button") %> + <%= f.submit %> <% end %> <% if @entry.subscribers.exists?(current_user.id) %>
<%= link_to t("javascripts.changesets.show.unsubscribe"), diary_entry_unsubscribe_path(:display_name => @entry.user.display_name, :id => @entry.id), :method => :post, :class => :button %>
diff --git a/app/views/issues/_comments.html.erb b/app/views/issues/_comments.html.erb index 13f5bb192..7ff0948db 100644 --- a/app/views/issues/_comments.html.erb +++ b/app/views/issues/_comments.html.erb @@ -20,6 +20,6 @@ <%= label_tag :reassign, t(".reassign_param") %> <%= check_box_tag :reassign, true %>

- <%= submit_tag "Submit" %> + <%= f.submit %> <% end %> diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb index 532f3d71e..2429feb52 100644 --- a/app/views/messages/new.html.erb +++ b/app/views/messages/new.html.erb @@ -16,7 +16,7 @@ <%= richtext_area :message, :body, :cols => 80, :rows => 20 %>
- <%= submit_tag t(".send_button") %> + <%= f.submit %> <%= link_to t(".back_to_inbox"), inbox_messages_path, :class => "deemphasize button" %>
diff --git a/app/views/oauth_clients/edit.html.erb b/app/views/oauth_clients/edit.html.erb index d6211778b..d696baae3 100644 --- a/app/views/oauth_clients/edit.html.erb +++ b/app/views/oauth_clients/edit.html.erb @@ -4,5 +4,5 @@ <%= form_for @client_application, :url => oauth_client_path(@client_application.user.display_name, @client_application), :html => { :method => :put } do |f| %> <%= render :partial => "form", :locals => { :f => f } %> - <%= submit_tag t ".submit" %> + <%= f.submit %> <% end %> diff --git a/app/views/oauth_clients/new.html.erb b/app/views/oauth_clients/new.html.erb index 0a49f48f8..d9cc05d02 100644 --- a/app/views/oauth_clients/new.html.erb +++ b/app/views/oauth_clients/new.html.erb @@ -3,8 +3,8 @@ <% end %>
- <%= form_for :client_application, :url => { :action => :create } do |f| %> + <%= form_for @client_application, :url => { :action => :create } do |f| %> <%= render :partial => "form", :locals => { :f => f } %> - <%= submit_tag t(".submit") %> + <%= f.submit %> <% end %>
diff --git a/app/views/redactions/edit.html.erb b/app/views/redactions/edit.html.erb index 72676013e..cef618859 100644 --- a/app/views/redactions/edit.html.erb +++ b/app/views/redactions/edit.html.erb @@ -16,6 +16,6 @@ <%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>

- <%= f.submit t(".submit") %> + <%= f.submit %>

<% end %> diff --git a/app/views/redactions/new.html.erb b/app/views/redactions/new.html.erb index 9f2adac19..a76d8ec48 100644 --- a/app/views/redactions/new.html.erb +++ b/app/views/redactions/new.html.erb @@ -15,6 +15,6 @@ <%= richtext_area :redaction, :description, :cols => 80, :rows => 20, :format => @redaction.description_format %>

- <%= f.submit t(".submit") %> + <%= f.submit %>

<% end %> diff --git a/app/views/traces/edit.html.erb b/app/views/traces/edit.html.erb index c17660db3..2deae8ac2 100644 --- a/app/views/traces/edit.html.erb +++ b/app/views/traces/edit.html.erb @@ -50,6 +50,6 @@ -<%= submit_tag t ".save_button" %> +<%= f.submit %> <% end %> diff --git a/app/views/traces/new.html.erb b/app/views/traces/new.html.erb index 51cd16308..fc6a9f1a9 100644 --- a/app/views/traces/new.html.erb +++ b/app/views/traces/new.html.erb @@ -27,7 +27,7 @@ - <%= submit_tag t(".upload_button") %> + <%= f.submit %> "><%= t ".help" %> <% end %> diff --git a/app/views/user_blocks/edit.html.erb b/app/views/user_blocks/edit.html.erb index 6f0ea991b..88d7e4f23 100644 --- a/app/views/user_blocks/edit.html.erb +++ b/app/views/user_blocks/edit.html.erb @@ -25,6 +25,6 @@ <%= f.label :needs_view, t(".needs_view") %>

- <%= f.submit t(".submit") %> + <%= f.submit %>

<% end %> diff --git a/app/views/user_blocks/new.html.erb b/app/views/user_blocks/new.html.erb index aa4bf7132..bd492a354 100644 --- a/app/views/user_blocks/new.html.erb +++ b/app/views/user_blocks/new.html.erb @@ -21,7 +21,7 @@

<%= hidden_field_tag "display_name", @user.display_name %> - <%= f.submit t(".submit") %> + <%= f.submit %>

<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 6426ee56b..d7127a4e9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -7,9 +7,27 @@ en: blog: "%e %B %Y" helpers: submit: + diary_comment: + create: Save diary_entry: create: "Publish" update: "Update" + issue_comment: + create: Add Comment + message: + create: Send + client_application: + create: Register + update: Edit + redaction: + create: Create redaction + update: Save redaction + trace: + create: Upload + update: Save Changes + user_block: + create: Create block + update: Update block activerecord: errors: messages: @@ -316,7 +334,6 @@ en: leave_a_comment: "Leave a comment" login_to_leave_a_comment: "%{login_link} to leave a comment" login: "Login" - save_button: "Save" no_such_entry: title: "No such diary entry" heading: "No entry with the id: %{id}" @@ -1228,7 +1245,6 @@ en: send_message_to: "Send a new message to %{name}" subject: "Subject" body: "Body" - send_button: "Send" back_to_inbox: "Back to inbox" create: message_sent: "Message sent" @@ -1745,7 +1761,6 @@ en: visibility: "Visibility:" visibility_help: "what does this mean?" visibility_help_url: "https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces" - upload_button: "Upload" help: "Help" help_url: "https://wiki.openstreetmap.org/wiki/Upload" create: @@ -1769,7 +1784,6 @@ en: description: "Description:" tags: "Tags:" tags_help: "comma delimited" - save_button: "Save Changes" visibility: "Visibility:" visibility_help: "what does this mean?" visibility_help_url: "https://wiki.openstreetmap.org/wiki/Visibility_of_GPS_traces" @@ -1881,10 +1895,8 @@ en: oauth_clients: new: title: "Register a new application" - submit: "Register" edit: title: "Edit your application" - submit: "Edit" show: title: "OAuth details for %{app_name}" key: "Consumer Key:" @@ -2287,7 +2299,6 @@ en: heading: "Creating block on %{name}" reason: "The reason why %{name} is being blocked. Please be as calm and as reasonable as possible, giving as much detail as you can about the situation, remembering that the message will be publicly visible. Bear in mind that not all users understand the community jargon, so please try to use laymans terms." period: "How long, starting now, the user will be blocked from the API for." - submit: "Create block" tried_contacting: "I have contacted the user and asked them to stop." tried_waiting: "I have given a reasonable amount of time for the user to respond to those communications." needs_view: "User needs to log in before this block will be cleared" @@ -2297,7 +2308,6 @@ en: heading: "Editing block on %{name}" reason: "The reason why %{name} is being blocked. Please be as calm and as reasonable as possible, giving as much detail as you can about the situation. Bear in mind that not all users understand the community jargon, so please try to use laymans terms." period: "How long, starting now, the user will be blocked from the API for." - submit: "Update block" show: "View this block" back: "View all blocks" needs_view: "Does the user need to log in before this block will be cleared?" @@ -2572,7 +2582,6 @@ en: edit: description: "Description" heading: "Edit redaction" - submit: "Save redaction" title: "Edit redaction" index: empty: "No redactions to show." @@ -2581,7 +2590,6 @@ en: new: description: "Description" heading: "Enter information for new redaction" - submit: "Create redaction" title: "Creating new redaction" show: description: "Description:" diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 0f46ad3ec..60322763e 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -18,4 +18,10 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase .to_return(:status => 404) super(*args) end + + # Phantomjs can pick up browser Accept-Language preferences from your desktop environment. + # We don't want this to happen during the tests! + setup do + page.driver.add_headers("Accept-Language" => "en") + end end diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb index f2421599f..08b1acb34 100644 --- a/test/system/issues_test.rb +++ b/test/system/issues_test.rb @@ -78,7 +78,7 @@ class IssuesTest < ApplicationSystemTestCase visit issue_path(issue) fill_in :issue_comment_body, :with => "test comment" - click_on "Submit" + click_on "Add Comment" assert page.has_content?(I18n.t("issue_comments.create.comment_created")) assert page.has_content?("test comment") @@ -95,7 +95,7 @@ class IssuesTest < ApplicationSystemTestCase fill_in :issue_comment_body, :with => "reassigning to moderators" check :reassign - click_on "Submit" + click_on "Add Comment" issue.reload assert_equal "moderator", issue.assigned_role