From 750fc9e199259ce1820cb92023287046ab2e7143 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 29 May 2018 19:29:19 +0300 Subject: [PATCH] Set contact form default locale to ET --- app/controllers/whois_records_controller.rb | 5 +++++ app/views/whois_records/_private_person.json.jbuilder | 3 ++- test/integration/whois_records/json_test.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/whois_records_controller.rb b/app/controllers/whois_records_controller.rb index c095cbc4..9a31a310 100644 --- a/app/controllers/whois_records_controller.rb +++ b/app/controllers/whois_records_controller.rb @@ -1,5 +1,6 @@ class WhoisRecordsController < ApplicationController helper_method :ip_in_whitelist? + helper_method :contact_form_default_locale def show domain_name = SimpleIDN.to_unicode(params[:name].to_s).downcase @@ -55,4 +56,8 @@ def ip_in_whitelist? def captcha_solved? verify_recaptcha end + + def contact_form_default_locale + :et + end end diff --git a/app/views/whois_records/_private_person.json.jbuilder b/app/views/whois_records/_private_person.json.jbuilder index ff87d9b5..c34129bd 100644 --- a/app/views/whois_records/_private_person.json.jbuilder +++ b/app/views/whois_records/_private_person.json.jbuilder @@ -38,4 +38,5 @@ json.admin_contacts do end end -json.contact_form_link new_contact_request_url({ domain_name: whois_record.name }) +json.contact_form_link new_contact_request_url({ domain_name: whois_record.name, + locale: contact_form_default_locale }) diff --git a/test/integration/whois_records/json_test.rb b/test/integration/whois_records/json_test.rb index c208b52d..729c8fb2 100644 --- a/test/integration/whois_records/json_test.rb +++ b/test/integration/whois_records/json_test.rb @@ -72,7 +72,7 @@ def test_json_all_fields_are_present 'tech_contacts': [{'changed': 'Not Disclosed', 'email': 'Not Disclosed', 'name': 'Not Disclosed'}], - 'contact_form_link': 'http://www.example.com/contact_requests/new?domain_name=privatedomain.test&locale=en' + 'contact_form_link': 'http://www.example.com/contact_requests/new?domain_name=privatedomain.test&locale=et' }.with_indifferent_access get('/v1/privatedomain.test.json')