diff --git a/lib/geocoder/lookups/amazon_location_service.rb b/lib/geocoder/lookups/amazon_location_service.rb index 7179430e2..4b37e3182 100644 --- a/lib/geocoder/lookups/amazon_location_service.rb +++ b/lib/geocoder/lookups/amazon_location_service.rb @@ -11,14 +11,17 @@ def results(query) params.merge!(index_name: configuration[:index_name]) # Aws::ParamValidator raises ArgumentError on unexpected keys - params.delete(:lookup) - + params.delete(:lookup) + + # Inherit language from configuration + params.merge!(language: configuration[:language]) + resp = if query.reverse_geocode? client.search_place_index_for_position(params.merge(position: query.coordinates.reverse)) else client.search_place_index_for_text(params.merge(text: query.text)) end - + resp.results end