]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/3963'
authorTom Hughes <tom@compton.nu>
Wed, 8 Mar 2023 17:07:34 +0000 (17:07 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 8 Mar 2023 17:07:34 +0000 (17:07 +0000)
13 files changed:
Gemfile
Gemfile.lock
app/assets/javascripts/index/search.js
app/views/confirmations/confirm.html.erb
app/views/shared/_markdown_help.html.erb
app/views/site/_potlatch.html.erb
app/views/site/communities.html.erb
app/views/site/fixthemap.html.erb
app/views/users/terms.html.erb
config/i18n-tasks.yml [new file with mode: 0644]
config/locales/en.yml
config/routes.rb
test/controllers/geocoder_controller_test.rb

diff --git a/Gemfile b/Gemfile
index 8a5d4432a06425e1f6d0b9ff2d9bf0cf2009a3a8..c25240f9ff0623f547dfc17f46942484e27b7efe 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -137,6 +137,7 @@ group :development do
   gem "better_errors"
   gem "binding_of_caller"
   gem "debug_inspector"
+  gem "i18n-tasks"
   gem "listen"
   gem "vendorer"
 end
index c94a4293497f553665377b5c2da78017259b55b9..5d999ed003819a7e8976404a14a4e4119fe0a5f6 100644 (file)
@@ -232,12 +232,24 @@ GEM
       activesupport (>= 5.0)
     hashdiff (1.0.1)
     hashie (5.0.0)
+    highline (2.1.0)
     htmlentities (4.3.4)
     http_accept_language (2.1.1)
     i18n (1.12.0)
       concurrent-ruby (~> 1.0)
     i18n-js (3.9.2)
       i18n (>= 0.6.6)
+    i18n-tasks (1.0.12)
+      activesupport (>= 4.0.2)
+      ast (>= 2.1.0)
+      better_html (>= 1.0, < 3.0)
+      erubi
+      highline (>= 2.0.0)
+      i18n
+      parser (>= 2.2.3.0)
+      rails-i18n
+      rainbow (>= 2.2.2, < 4.0)
+      terminal-table (>= 1.5.1)
     image_optim (0.31.3)
       exifr (~> 1.2, >= 1.2.2)
       fspath (~> 3.0)
@@ -488,6 +500,8 @@ GEM
       sprockets (>= 3.0.0)
     strong_migrations (1.4.3)
       activerecord (>= 5.2)
+    terminal-table (3.0.2)
+      unicode-display_width (>= 1.1.1, < 3)
     terser (1.1.14)
       execjs (>= 0.3.0, < 3)
     thor (1.2.1)
@@ -552,6 +566,7 @@ DEPENDENCIES
   htmlentities
   http_accept_language (~> 2.1.1)
   i18n-js (~> 3.9.2)
+  i18n-tasks
   image_optim_rails
   image_processing
   jbuilder (~> 2.7)
index 10750b5b7222e10bfcd0103e96dad4625abc423a..b7bca1d2ac08e5dcb2f9ef31b23c0f36ef496845 100644 (file)
@@ -129,17 +129,21 @@ OSM.Search = function (map) {
 
   page.load = function () {
     $(".search_results_entry").each(function (index) {
-      var entry = $(this);
+      var entry = $(this),
+          csrf_param = $("meta[name=csrf-param]").attr("content"),
+          csrf_token = $("meta[name=csrf-token]").attr("content"),
+          params = {
+            zoom: map.getZoom(),
+            minlon: map.getBounds().getWest(),
+            minlat: map.getBounds().getSouth(),
+            maxlon: map.getBounds().getEast(),
+            maxlat: map.getBounds().getNorth()
+          };
+      params[csrf_param] = csrf_token;
       $.ajax({
         url: entry.data("href"),
-        method: "GET",
-        data: {
-          zoom: map.getZoom(),
-          minlon: map.getBounds().getWest(),
-          minlat: map.getBounds().getSouth(),
-          maxlon: map.getBounds().getEast(),
-          maxlat: map.getBounds().getNorth()
-        },
+        method: "POST",
+        data: params,
         success: function (html) {
           entry.html(html);
           // go to first result of first geocoder
index 7350f86287494a9e4af12fc15c4bff07f35bbd06..879fb8f337cebf45c1a4f15ff46efdd1d5c422a6 100644 (file)
@@ -27,6 +27,8 @@
     </span>
   </h1>
 
-  <p class='text-muted'><%= t ".reconfirm_html",
-                              :reconfirm => url_for(:action => "confirm_resend") %></p>
+  <p class='text-muted'>
+    <%= t ".resend_html",
+          :reconfirm_link => link_to(t(".click_here"), url_for(:action => "confirm_resend")) %>
+  </p>
 <% end %>
index 5bd8c4955deb47b2af277a304e1dc8189631d151..9097c9d9174c162b55cfddea5f37bc95e2fb6bf7 100644 (file)
@@ -1,4 +1,6 @@
-<h5><%= t ".title_html" %></h5>
+<h5>
+  <%= t ".heading_html", :kramdown_link => link_to(t(".kramdown"), t(".kramdown_url")) %>
+</h5>
 <dl>
   <dt><%= t ".headings" %></dt>
   <dd># <%= t ".heading" %><br>
index 790a3bf5d057497713a449e9eb930ca217ee5459..909a4cb414a707fc22cc744f40109dbb5c81bb13 100644 (file)
@@ -1,5 +1,5 @@
 <div class="container">
   <p><%= t ".removed" %></p>
-  <p><%= t ".desktop_html" %></p>
-  <p><%= t ".id_html", :settings_url => preferences_path %></p>
+  <p><%= t ".desktop_application_html", :download_link => link_to(t(".download"), t(".download_url")) %></p>
+  <p><%= t ".id_editor_html", :change_preferences_link => link_to(t(".change_preferences"), preferences_path) %></p>
 </div>
index c2140668379ba951d202a6051c120e1476fcab9e..21b5c235c541d2e204999eab7c2bdbb982b06a5e 100644 (file)
@@ -20,4 +20,5 @@
 </ul>
 
 <h2><%= t ".other_groups.title" %></h2>
-<p><%= t ".other_groups.about_html" %></p>
+<p><%= t ".other_groups.other_groups_html", :communities_wiki_link => link_to(t(".other_groups.communities_wiki"),
+                                                                              t(".other_groups.communities_wiki_url")) %>
index fe6cf22c59b3eb8aae18d5ec8b01ad7ea092a382..ab8684116b4f580bd431243ada702d4ac189c465 100644 (file)
@@ -27,6 +27,9 @@
 </div>
 
 <h2><%= t ".other_concerns.title" %></h2>
-<p><%= t ".other_concerns.explanation_html" %></p>
+<p>
+  <%= t ".other_concerns.concerns_html", :copyright_link => link_to(t(".other_concerns.copyright"), copyright_path),
+                                         :working_group_link => link_to(t(".other_concerns.working_group"), t(".other_concerns.working_group_url")) %>
+</p>
 
 <%= render "any_questions" %>
index f161667029dbad3b7cd8d8602d8aa518919020b1..e2ece8f1a9b3049f681e91d4175456af5e988de0 100644 (file)
 
   <div>
     <p id="contributorGuidance" class="text-muted">
-      <%= t ".guidance_html",
-            :summary => "https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary",
-            :translations => "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations" %>
+      <%= t ".guidance_info_html",
+            :readable_summary_link => link_to(t(".readable_summary"),
+                                              "https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary"),
+            :informal_translations_link => link_to(t(".informal_translations"),
+                                                   "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations") %>
     </p>
   </div>
   <div class="mb-3">
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml
new file mode 100644 (file)
index 0000000..60f8a09
--- /dev/null
@@ -0,0 +1,160 @@
+# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
+
+# The "main" locale.
+base_locale: en
+## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
+# locales: [es, fr]
+## Reporting locale, default: en. Available: en, ru.
+# internal_locale: en
+
+# Read and write translations.
+data:
+  ## Translations are read from the file system. Supported format: YAML, JSON.
+  ## Provide a custom adapter:
+  # adapter: I18n::Tasks::Data::FileSystem
+
+  # Locale files or `File.find` patterns where translations are read from:
+  read:
+    ## Default:
+    - config/locales/en.yml
+    ## More files:
+    # - config/locales/**/*.%{locale}.yml
+
+  # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
+  # `i18n-tasks normalize -p` will force move the keys according to these rules
+  write:
+    ## For example, write devise and simple form keys to their respective files:
+    # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
+    ## Catch-all default:
+    # - config/locales/%{locale}.yml
+
+  # External locale data (e.g. gems).
+  # This data is not considered unused and is never written to.
+  external:
+    ## Example (replace %#= with %=):
+    # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
+
+  ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
+  # router: conservative_router
+
+  yaml:
+    write:
+      # do not wrap lines at 80 characters
+      line_width: -1
+
+  ## Pretty-print JSON:
+  # json:
+  #   write:
+  #     indent: '  '
+  #     space: ' '
+  #     object_nl: "\n"
+  #     array_nl: "\n"
+
+# Find translate calls
+search:
+  ## Paths or `File.find` patterns to search in:
+  # paths:
+  #  - app/
+
+  ## Root directories for relative keys resolution.
+  # relative_roots:
+  #   - app/controllers
+  #   - app/helpers
+  #   - app/mailers
+  #   - app/presenters
+  #   - app/views
+
+  ## Directories where method names which should not be part of a relative key resolution.
+  # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key.
+  # Directories listed here will not consider the name of the method part of the resolved key
+  #
+  # relative_exclude_method_name_paths:
+  #  -
+
+  ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
+  ##   *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less
+  ##   *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx
+  exclude:
+    - app/assets/images
+    - app/assets/fonts
+    - app/assets/videos
+    - app/assets/builds
+
+  ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
+  ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
+  # only: ["*.rb", "*.html.slim"]
+
+  ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
+  strict: false
+
+  ## Allows adding ast_matchers for finding translations using the AST-scanners
+  ## The available matchers are:
+  ## - RailsModelMatcher
+  ##     Matches ActiveRecord translations like
+  ##     User.human_attribute_name(:email) and User.model_name.human
+  ##
+  ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`.
+  <%# I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %>
+
+  ## Multiple scanners can be used. Their results are merged.
+  ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
+  ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
+
+## Translation Services
+# translation:
+#   # Google Translate
+#   # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
+#   google_translate_api_key: "AbC-dEf5"
+#   # DeepL Pro Translate
+#   # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
+#   deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
+#   # deepl_host: "https://api.deepl.com"
+#   # deepl_version: "v2"
+
+## Do not consider these keys missing:
+# ignore_missing:
+# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
+# - '{devise,simple_form}.*'
+
+## Consider these keys used:
+ignore_unused:
+  - 'geocoder.search_osm_nominatim.prefix.*'
+  - 'javascripts.*'
+  - 'activerecord.attributes.*'
+  - 'activerecord.models.*'
+  - 'activerecord.help.*'
+  - 'helpers.submit.*'
+  - 'datetime.distance_in_words_ago.*'
+  - 'reports.new.categories.*' # double interpolation in reports_helper
+# - '{devise,kaminari,will_paginate}.*'
+# - 'simple_form.{yes,no}'
+# - 'simple_form.{placeholders,hints,labels}.*'
+# - 'simple_form.{error_notification,required}.:'
+
+## Exclude these keys from the `i18n-tasks eq-base' report:
+# ignore_eq_base:
+#   all:
+#     - common.ok
+#   fr,es:
+#     - common.brand
+
+## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
+# ignore_inconsistent_interpolations:
+# - 'activerecord.attributes.*'
+
+## Ignore these keys completely:
+# ignore:
+#  - kaminari.*
+
+## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
+## e.g. in case of a relative key defined in a helper method.
+## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
+#
+# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
+#       only: %w(*.html.haml *.html.slim),
+#       patterns: [['= title\b', '.page_title']] %>
+#
+# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
+#
+# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
+#       patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
index fc01c22ae50c343d5c2213c3ef20a9c6d11d998b..ca1d313c8df7ebc1dbe32f6de6817bb1520c8ea2 100644 (file)
@@ -52,7 +52,6 @@ en:
       message: "Message"
       node: "Node"
       node_tag: "Node Tag"
-      notifier: "Notifier"
       old_node: "Old Node"
       old_node_tag: "Old Node Tag"
       old_relation: "Old Relation"
@@ -1399,10 +1398,6 @@ en:
         ignored: Ignored
         open: Open
         resolved: Resolved
-    update:
-      new_report: Your report has been registered successfully
-      successful_update: Your report has been updated successfully
-      provide_details: Please provide the required details
     show:
       title: "%{status} Issue #%{issue_id}"
       reports:
@@ -1485,10 +1480,8 @@ en:
     home: Go to Home Location
     logout: Log Out
     log_in: Log In
-    log_in_tooltip: Log in with an existing account
     sign_up: Sign Up
     start_mapping: Start Mapping
-    sign_up_tooltip: Create an account for editing
     edit: Edit
     history: History
     export: Export
@@ -1520,8 +1513,6 @@ en:
     community: Community
     community_blogs: "Community Blogs"
     community_blogs_title: "Blogs from members of the OpenStreetMap community"
-    foundation: Foundation
-    foundation_title: The OpenStreetMap Foundation
     make_a_donation:
       title: Support OpenStreetMap with a monetary donation
       text: Make a Donation
@@ -1636,7 +1627,8 @@ en:
       success: "Confirmed your account, thanks for signing up!"
       already active: "This account has already been confirmed."
       unknown token: "That confirmation code has expired or does not exist."
-      reconfirm_html: "If you need us to resend the confirmation email, <a href=\"%{reconfirm}\">click here</a>."
+      resend_html: "If you need us to resend the confirmation email, %{reconfirm_link}."
+      click_here: click here
     confirm_resend:
       failure: "User %{name} not found."
     confirm_email:
@@ -1674,8 +1666,6 @@ en:
     new:
       title: "Send message"
       send_message_to_html: "Send a new message to %{name}"
-      subject: "Subject"
-      body: "Body"
       back_to_inbox: "Back to inbox"
     create:
       message_sent: "Message sent"
@@ -1700,14 +1690,10 @@ en:
       wrong_user: "You are logged in as `%{user}' but the message you have asked to reply to was not sent to that user. Please login as the correct user in order to reply."
     show:
       title: "Read message"
-      from: "From"
-      subject: "Subject"
-      date: "Date"
       reply_button: "Reply"
       unread_button: "Mark as unread"
       destroy_button: "Delete"
       back: "Back"
-      to: "To"
       wrong_user: "You are logged in as `%{user}' but the message you have asked to read was not sent by or to that user. Please login as the correct user in order to read it."
     sent_message_summary:
       destroy_button: "Delete"
@@ -1779,13 +1765,8 @@ en:
       lost password link: "Lost your password?"
       login_button: "Login"
       register now: Register now
-      with username: "Already have an OpenStreetMap account? Please login with your username and password:"
       with external: "Alternatively, use a third party to login:"
-      new to osm: New to OpenStreetMap?
-      to make changes: To make changes to the OpenStreetMap data, you must have an account.
-      create account minute: Create an account. It only takes a minute.
       no account: Don't have an account?
-      account not active: "Sorry, your account is not active yet.<br />Please use the link in the account confirmation email to activate your account, or <a href=\"%{reconfirm}\">request a new confirmation email</a>."
       auth failure: "Sorry, could not log in with those details."
       openid_logo_alt: "Log in with an OpenID"
       auth_providers:
@@ -1823,7 +1804,9 @@ en:
       support: support
   shared:
     markdown_help:
-      title_html: Parsed with <a href="https://kramdown.gettalong.org/quickref.html">kramdown</a>
+      heading_html: Parsed with %{kramdown_link}
+      kramdown_url: https://kramdown.gettalong.org/quickref.html
+      kramdown: kramdown
       headings: Headings
       heading: Heading
       subheading: Subheading
@@ -2005,7 +1988,7 @@ en:
         contributors_gb_html: |
           <strong>United Kingdom</strong>: Contains Ordnance
           Survey data &copy; Crown copyright and database right
-          2010-19.
+          2010-2023.
         contributors_footer_1_html: |
           For further details of these, and other sources that have been used
           to help improve OpenStreetMap, please see the <a
@@ -2073,9 +2056,6 @@ en:
         geofabrik:
           title: "Geofabrik Downloads"
           description: "Regularly-updated extracts of continents, countries, and selected cities"
-        metro:
-          title: "Metro Extracts"
-          description: "Extracts for major world cities and their surrounding areas"
         other:
           title: "Other Sources"
           description: "Additional sources listed on the OpenStreetMap Wiki"
@@ -2107,10 +2087,12 @@ en:
             by dragging. Add your message, then click save, and other mappers will investigate.
       other_concerns:
         title: Other concerns
-        explanation_html: |
+        concerns_html: |
           If you have concerns about how our data is being used or about the contents please consult our
-          <a href='/copyright'>copyright page</a> for more legal information, or contact the appropriate
-          <a href='https://wiki.osmfoundation.org/wiki/Working_Groups'>OSMF working group</a>.
+          %{copyright_link} for more legal information, or contact the appropriate %{working_group_link}.
+        copyright: copyright page
+        working_group: OSMF working group
+        working_group_url: https://wiki.osmfoundation.org/wiki/Working_Groups
     help:
       title: Getting Help
       introduction: |
@@ -2158,8 +2140,11 @@ en:
         description: Browse the wiki for in-depth OpenStreetMap documentation.
     potlatch:
       removed: Your default OpenStreetMap editor is set as Potlatch. Because Adobe Flash Player has been withdrawn, Potlatch is no longer available to use in a web browser.
-      desktop_html: You can still use Potlatch by <a href="https://www.systemed.net/potlatch/">downloading the desktop application for Mac and Windows</a>.
-      id_html: Alternatively, you can set your default editor to iD, which runs in your web browser as Potlatch formerly did. <a href="%{settings_url}">Change your preferences here</a>.
+      desktop_application_html: You can still use Potlatch by %{download_link}.
+      download: downloading the desktop application for Mac and Windows
+      download_url: https://www.systemed.net/potlatch/
+      id_editor_html: Alternatively, you can set your default editor to iD, which runs in your web browser as Potlatch formerly did. %{change_preferences_link}.
+      change_preferences: Change your preferences here
     any_questions:
       title: Any questions?
       paragraph_1_html: |
@@ -2324,11 +2309,12 @@ en:
           The following communities are formally established as Local Chapters:
       other_groups:
         title: Other Groups
-        about_html: |
+        other_groups_html: |
           There is no need to formally establish a group to the same extent as the Local Chapters.
           Indeed many groups exist very sucessfully as an informal gathering of people or as a
-          community group. Anyone can set up or join these. Read more on the
-          <a href="https://wiki.openstreetmap.org/wiki/User_group">Communities wiki page</a>.
+          community group. Anyone can set up or join these. Read more on the %{communities_wiki_link}.
+        communities_wiki: Communities wiki page
+        communities_wiki_url: https://wiki.openstreetmap.org/wiki/User_group
   traces:
     visibility:
       private: "Private (only shared as anonymous, unordered points)"
@@ -2575,9 +2561,6 @@ en:
         header: Free and editable
         paragraph_1: Unlike other maps, OpenStreetMap is completely created by people like you, and it's free for anyone to fix, update, download and use.
         paragraph_2: Sign up to get started contributing. We'll send an email to confirm your account.
-      email address: "Email Address:"
-      confirm email address: "Confirm Email Address:"
-      display name: "Display Name:"
       display name description: "Your publicly displayed username. You can change this later in the preferences."
       external auth: "Third Party Authentication:"
       use external auth: "Alternatively, use a third party to login"
@@ -2596,7 +2579,9 @@ en:
       consider_pd: "In addition to the above, I consider my contributions to be in the Public Domain"
       consider_pd_why: "what's this?"
       consider_pd_why_url: https://wiki.osmfoundation.org/wiki/Licence_and_Legal_FAQ/Why_would_I_want_my_contributions_to_be_public_domain
-      guidance_html: 'Information to help understand these terms: a <a href="%{summary}">human readable summary</a> and some <a href="%{translations}">informal translations</a>'
+      guidance_info_html: "Information to help understand these terms: a %{readable_summary_link} and some %{informal_translations_link}"
+      readable_summary: human readable summary
+      informal_translations: informal translations
       continue: Continue
       declined: "https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
       decline: "Decline"
@@ -2617,7 +2602,6 @@ en:
       deleted: "deleted"
     show:
       my diary: My Diary
-      new diary entry: new diary entry
       my edits: My Edits
       my traces: My Traces
       my notes: My Notes
@@ -2646,8 +2630,6 @@ en:
       created from: "Created from:"
       status: "Status:"
       spam score: "Spam Score:"
-      description: Description
-      user location: User location
       role:
         administrator: "This user is an administrator"
         moderator: "This user is a moderator"
@@ -2662,7 +2644,6 @@ en:
       comments: "Comments"
       create_block: "Block this User"
       activate_user: "Activate this User"
-      deactivate_user: "Deactivate this User"
       confirm_user: "Confirm this User"
       unconfirm_user: "Unconfirm this User"
       unsuspend_user: "Unsuspend this User"
@@ -2671,8 +2652,6 @@ en:
       delete_user: "Delete this User"
       confirm: "Confirm"
       report: Report this User
-    set_home:
-      flash success: "Home location saved successfully"
     go_public:
       flash success: "All your edits are now public, and you are now allowed to edit."
     index:
@@ -2692,7 +2671,6 @@ en:
       support: support
       automatically_suspended: Sorry, your account has been automatically suspended due to suspicious activity.
       contact_support_html: This decision will be reviewed by an administrator shortly, or you may contact %{support_link} if you wish to discuss this.
-      support: support
     auth_failure:
       connection_failed: Connection to authentication provider failed
       invalid_credentials: Invalid authentication credentials
@@ -2738,8 +2716,6 @@ en:
       title: "Creating block on %{name}"
       heading_html: "Creating block on %{name}"
       period: "How long, starting now, the user will be blocked from the API for."
-      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."
       back: "View all blocks"
     edit:
       title: "Editing block on %{name}"
@@ -2751,8 +2727,6 @@ en:
       block_expired: "The block has already expired and cannot be edited."
       block_period: "The blocking period must be one of the values selectable in the drop-down list."
     create:
-      try_contacting: "Please try contacting the user before blocking them and giving them a reasonable time to respond."
-      try_waiting: "Please try giving the user a reasonable time to respond before blocking them."
       flash: "Created a block on user %{name}."
     update:
       only_creator_can_edit: "Only the moderator who created this block can edit it."
index c0fbf202091b9fcd26975e7f955dc5938b573cb6..04a6908df88fc27a35d2b72e2a68f9ade1c360ed 100644 (file)
@@ -260,9 +260,9 @@ OpenStreetMap::Application.routes.draw do
 
   # geocoder
   get "/search" => "geocoder#search"
-  get "/geocoder/search_latlon" => "geocoder#search_latlon"
-  get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
-  get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
+  post "/geocoder/search_latlon" => "geocoder#search_latlon"
+  post "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim"
+  post "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse"
 
   # directions
   get "/directions" => "directions#search"
index 0d3b80e9e380787f3d84f228e3222c5507f12bec..dd740e57034e749798736eb47f400067fe0aba07 100644 (file)
@@ -9,15 +9,15 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
       { :controller => "geocoder", :action => "search" }
     )
     assert_routing(
-      { :path => "/geocoder/search_latlon", :method => :get },
+      { :path => "/geocoder/search_latlon", :method => :post },
       { :controller => "geocoder", :action => "search_latlon" }
     )
     assert_routing(
-      { :path => "/geocoder/search_osm_nominatim", :method => :get },
+      { :path => "/geocoder/search_osm_nominatim", :method => :post },
       { :controller => "geocoder", :action => "search_osm_nominatim" }
     )
     assert_routing(
-      { :path => "/geocoder/search_osm_nominatim_reverse", :method => :get },
+      { :path => "/geocoder/search_osm_nominatim_reverse", :method => :post },
       { :controller => "geocoder", :action => "search_osm_nominatim_reverse" }
     )
   end
@@ -263,43 +263,43 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
   ##
   # Test the builtin latitude+longitude search
   def test_search_latlon
-    get geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16), :xhr => true
+    post geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16), :xhr => true
     results_check :name => "1.23, 4.56", :lat => 1.23, :lon => 4.56, :zoom => 16
 
-    get geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16), :xhr => true
+    post geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16), :xhr => true
     results_check_error "Latitude -91.23 out of range"
 
-    get geocoder_search_latlon_path(:lat => 91.23, :lon => 4.56, :zoom => 16), :xhr => true
+    post geocoder_search_latlon_path(:lat => 91.23, :lon => 4.56, :zoom => 16), :xhr => true
     results_check_error "Latitude 91.23 out of range"
 
-    get geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16), :xhr => true
+    post geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16), :xhr => true
     results_check_error "Longitude -180.23 out of range"
 
-    get geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16), :xhr => true
+    post geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16), :xhr => true
     results_check_error "Longitude 180.23 out of range"
   end
 
   def test_search_latlon_digits
-    get geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check({ :name => "1.23, 4.56", :lat => 1.23, :lon => 4.56, :zoom => 16 },
                   { :name => "4.56, 1.23", :lat => 4.56, :lon => 1.23, :zoom => 16 })
 
-    get geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check :name => "4.56, -91.23", :lat => 4.56, :lon => -91.23, :zoom => 16
 
-    get geocoder_search_latlon_path(:lat => -1.23, :lon => 170.23, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => -1.23, :lon => 170.23, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check :name => "-1.23, 170.23", :lat => -1.23, :lon => 170.23, :zoom => 16
 
-    get geocoder_search_latlon_path(:lat => 91.23, :lon => 94.56, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => 91.23, :lon => 94.56, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check_error "Latitude or longitude are out of range"
 
-    get geocoder_search_latlon_path(:lat => -91.23, :lon => -94.56, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => -91.23, :lon => -94.56, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check_error "Latitude or longitude are out of range"
 
-    get geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check_error "Latitude or longitude are out of range"
 
-    get geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16, :latlon_digits => true), :xhr => true
+    post geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16, :latlon_digits => true), :xhr => true
     results_check_error "Latitude or longitude are out of range"
   end
 
@@ -307,17 +307,17 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
   # Test the nominatim forward search
   def test_search_osm_nominatim
     with_http_stubs "nominatim" do
-      get geocoder_search_osm_nominatim_path(:query => "Hoddesdon", :zoom => 10,
-                                             :minlon => -0.559, :minlat => 51.217,
-                                             :maxlon => 0.836, :maxlat => 51.766), :xhr => true
+      post geocoder_search_osm_nominatim_path(:query => "Hoddesdon", :zoom => 10,
+                                              :minlon => -0.559, :minlat => 51.217,
+                                              :maxlon => 0.836, :maxlat => 51.766), :xhr => true
       results_check "name" => "Hoddesdon, Hertfordshire, East of England, England, United Kingdom",
                     "min-lat" => 51.7216709, "max-lat" => 51.8016709,
                     "min-lon" => -0.0512898, "max-lon" => 0.0287102,
                     "type" => "node", "id" => 18007599
 
-      get geocoder_search_osm_nominatim_path(:query => "Broxbourne", :zoom => 10,
-                                             :minlon => -0.559, :minlat => 51.217,
-                                             :maxlon => 0.836, :maxlat => 51.766), :xhr => true
+      post geocoder_search_osm_nominatim_path(:query => "Broxbourne", :zoom => 10,
+                                              :minlon => -0.559, :minlat => 51.217,
+                                              :maxlon => 0.836, :maxlat => 51.766), :xhr => true
       results_check({ "prefix" => "Suburb",
                       "name" => "Broxbourne, Hertfordshire, East of England, England, United Kingdom",
                       "min-lat" => 51.7265723, "max-lat" => 51.7665723,
@@ -340,17 +340,17 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest
   # Test the nominatim reverse search
   def test_search_osm_nominatim_reverse
     with_http_stubs "nominatim" do
-      get geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 15), :xhr => true
+      post geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 15), :xhr => true
       results_check :name => "Broxbourne, Hertfordshire, East of England, England, United Kingdom",
                     :lat => 51.7465723, :lon => -0.0190782,
                     :type => "node", :id => 28825933, :zoom => 15
 
-      get geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 17), :xhr => true
+      post geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 17), :xhr => true
       results_check :name => "Dinant Link Road, Broxbourne, Hertfordshire, East of England, England, EN11 8HX, United Kingdom",
                     :lat => 51.7634883, :lon => -0.0088373,
                     :type => "way", :id => 3489841, :zoom => 17
 
-      get geocoder_search_osm_nominatim_reverse_path(:lat => 13.7709, :lon => 100.50507, :zoom => 19), :xhr => true
+      post geocoder_search_osm_nominatim_reverse_path(:lat => 13.7709, :lon => 100.50507, :zoom => 19), :xhr => true
       results_check :name => "MM Steak&Grill, ถนนศรีอยุธยา, บางขุนพรหม, กรุงเทพมหานคร, เขตดุสิต, กรุงเทพมหานคร, 10300, ประเทศไทย",
                     :lat => 13.7708691, :lon => 100.505073233221,
                     :type => "way", :id => 542901374, :zoom => 19