From d13ee637c4f1a64b5ab7d7b6cc413e3f71d2d11d Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Wed, 7 Oct 2020 17:43:36 +0500 Subject: [PATCH] Change disclaimer field to use i18zed from registry --- app/views/whois_record/inactive.erb | 6 ++++-- app/views/whois_record/legal_person.erb | 6 ++++-- app/views/whois_record/private_person.erb | 6 ++++-- test/models/private_person_record_test.rb | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/views/whois_record/inactive.erb b/app/views/whois_record/inactive.erb index e052ba9..0f3674a 100644 --- a/app/views/whois_record/inactive.erb +++ b/app/views/whois_record/inactive.erb @@ -1,7 +1,9 @@ -<%- if json['disclaimer'].present? -%> +<%- if json['disclaimer'].present? && json['disclaimer'].is_a?(String) -%> <%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> - +<%- elsif json['disclaimer'].present? && json['disclaimer'].is_a?(Hash) -%> +<%= json.dig('disclaimer', I18n.locale.to_s).scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> <%- end -%> + Estonia .ee Top Level Domain WHOIS server Domain: diff --git a/app/views/whois_record/legal_person.erb b/app/views/whois_record/legal_person.erb index 8487257..516ce3f 100644 --- a/app/views/whois_record/legal_person.erb +++ b/app/views/whois_record/legal_person.erb @@ -1,7 +1,9 @@ -<%- if json['disclaimer'].present? -%> +<%- if json['disclaimer'].present? && json['disclaimer'].is_a?(String) -%> <%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> - +<%- elsif json['disclaimer'].present? && json['disclaimer'].is_a?(Hash) -%> +<%= json.dig('disclaimer', I18n.locale.to_s).scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> <%- end -%> + Estonia .ee Top Level Domain WHOIS server Domain: diff --git a/app/views/whois_record/private_person.erb b/app/views/whois_record/private_person.erb index 41758eb..1eca7ce 100644 --- a/app/views/whois_record/private_person.erb +++ b/app/views/whois_record/private_person.erb @@ -1,7 +1,9 @@ -<%- if json['disclaimer'].present? -%> +<%- if json['disclaimer'].present? && json['disclaimer'].is_a?(String) -%> <%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> - +<%- elsif json['disclaimer'].present? && json['disclaimer'].is_a?(Hash) -%> +<%= json.dig('disclaimer', I18n.locale.to_s).scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %> <%- end -%> + Estonia .ee Top Level Domain WHOIS server Domain: diff --git a/test/models/private_person_record_test.rb b/test/models/private_person_record_test.rb index e078beb..486abcb 100644 --- a/test/models/private_person_record_test.rb +++ b/test/models/private_person_record_test.rb @@ -105,7 +105,7 @@ def create_private_person_record ], changed: "2018-04-25T14:10:41+03:00", delete: nil, - disclaimer: "The information obtained through .ee WHOIS is subject to database protection according to the Estonian Copyright Act and international conventions. All rights are reserved to Estonian Internet Foundation. Search results may not be used for commercial,advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities. Downloading of information about domain names for the creation of your own database is not permitted. If any of the information from .ee WHOIS is transferred to a third party, it must be done in its entirety. This server must not be used as a backend for a search engine.", + disclaimer: { en: "The information obtained through .ee WHOIS is subject to database protection according to the Estonian Copyright Act and international conventions. All rights are reserved to Estonian Internet Foundation. Search results may not be used for commercial,advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities. Downloading of information about domain names for the creation of your own database is not permitted. If any of the information from .ee WHOIS is transferred to a third party, it must be done in its entirety. This server must not be used as a backend for a search engine." }, dnssec_changed: nil, dnssec_keys: [