gem "better_errors"
gem "binding_of_caller"
gem "debug_inspector"
+ gem "i18n-tasks"
gem "listen"
gem "vendorer"
end
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)
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)
htmlentities
http_accept_language (~> 2.1.1)
i18n-js (~> 3.9.2)
+ i18n-tasks
image_optim_rails
image_processing
jbuilder (~> 2.7)
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
--- /dev/null
+# 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}']] %>
message: "Message"
node: "Node"
node_tag: "Node Tag"
- notifier: "Notifier"
old_node: "Old Node"
old_node_tag: "Old Node Tag"
old_relation: "Old Relation"
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:
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
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
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"
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"
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:
contributors_gb_html: |
<strong>United Kingdom</strong>: Contains Ordnance
Survey data © 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
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"
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"
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
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"
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"
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:
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
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}"
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."
# 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"
{ :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
##
# 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
# 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,
# 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