From 42b01512afa2e847d3ae2d2c9806b5fe2ce6615a Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Sun, 17 Jun 2018 19:28:01 +0300 Subject: [PATCH] Improve translations --- .../contacts/show/_address.html.erb | 20 +++++++--------- .../contacts/show/_domains.html.erb | 12 ++++++---- .../contacts/show/_general.html.erb | 24 ++++++++----------- .../contacts/show/_statuses.html.erb | 6 ++--- config/locales/registrant/contacts.en.yml | 17 +++++++++++++ 5 files changed, 46 insertions(+), 33 deletions(-) create mode 100644 config/locales/registrant/contacts.en.yml diff --git a/app/views/registrant/contacts/show/_address.html.erb b/app/views/registrant/contacts/show/_address.html.erb index 5804f89e9..c9bc80150 100644 --- a/app/views/registrant/contacts/show/_address.html.erb +++ b/app/views/registrant/contacts/show/_address.html.erb @@ -1,34 +1,30 @@

- <%= t(:address) %> + <%= t '.header' %>

<% if @contact.org_name.present? %> -
- <%= t(:org_name) %> -
-
- <%= @contact.org_name %> -
+
<%= Contact.human_attribute_name :org_name %>
+
<%= @contact.org_name %>
<% end %> -
<%= t(:street) %>
+
<%= Contact.human_attribute_name :street %>
<%= @contact.street %>
-
<%= t(:city) %>
+
<%= Contact.human_attribute_name :city %>
<%= @contact.city %>
-
<%= t(:zip) %>
+
<%= Contact.human_attribute_name :zip %>
<%= @contact.zip %>
-
<%= t(:state) %>
+
<%= Contact.human_attribute_name :state %>
<%= @contact.state %>
-
<%= t(:country) %>
+
<%= Contact.human_attribute_name :country %>
<%= @contact.country %>
diff --git a/app/views/registrant/contacts/show/_domains.html.erb b/app/views/registrant/contacts/show/_domains.html.erb index ce1cc271d..dbdb7d0fd 100644 --- a/app/views/registrant/contacts/show/_domains.html.erb +++ b/app/views/registrant/contacts/show/_domains.html.erb @@ -4,7 +4,7 @@
- <%= t(:domains) %> + <%= t '.header'%>
@@ -26,11 +26,15 @@ - + + - diff --git a/app/views/registrant/contacts/show/_general.html.erb b/app/views/registrant/contacts/show/_general.html.erb index db57f1b65..109d6316a 100644 --- a/app/views/registrant/contacts/show/_general.html.erb +++ b/app/views/registrant/contacts/show/_general.html.erb @@ -1,39 +1,35 @@

- <%= t(:general) %> + <%= t '.header' %>

-
<%= t(:id) %>
+
<%= Contact.human_attribute_name :code %>
<%= @contact.code %>
-
<%= t(:name) %>
+
<%= Contact.human_attribute_name :name %>
<%= @contact.name %>
-
<%= t(:password) %>
+
<%= Contact.human_attribute_name :auth_info %>
<%= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden' %>

-
<%= t(:ident) %>
+
<%= Contact.human_attribute_name :ident %>
<%= ident_for(@contact) %>
-
<%= t(:email) %>
+
<%= Contact.human_attribute_name :email %>
<%= @contact.email %>
-
<%= t(:phone) %>
+
<%= Contact.human_attribute_name :phone %>
<%= @contact.phone %>
<% if @contact.fax %> -
- <%= t(:fax) %> -
-
- <%= @contact.fax %> -
+
<%= Contact.human_attribute_name :fax %>
+
<%= @contact.fax %>
<% end %>
@@ -52,7 +48,7 @@ <%= @contact.name %> -
<%= t(:registrar_name) %>
+
<%= Registrar.model_name.human %>
<% if @contact.registrar.present? %> <%= link_to @contact.registrar, registrant_registrar_path(@contact.registrar) %> diff --git a/app/views/registrant/contacts/show/_statuses.html.erb b/app/views/registrant/contacts/show/_statuses.html.erb index e3bbab10d..90fb7cc73 100644 --- a/app/views/registrant/contacts/show/_statuses.html.erb +++ b/app/views/registrant/contacts/show/_statuses.html.erb @@ -1,15 +1,15 @@ <% panel_class = contact.errors.messages[:statuses] ? 'panel-danger' : 'panel-default' %>
- <%= t(:statuses) %> + <%= t '.header' %>
<%= custom_sort_link t(:domain_name), :name %> - <%= custom_sort_link t(:registrar_name), :registrar_name %> + <%= custom_sort_link Domain.human_attribute_name(:name), :name %> + + <%= custom_sort_link Registrar.model_name.human, :registrar_name %> + + <%= custom_sort_link Domain.human_attribute_name(:valid_to), :valid_to %> <%= custom_sort_link t(:valid_to), :valid_to %> <%= custom_sort_link Domain.human_attribute_name(:roles), :roles %>
- - + + diff --git a/config/locales/registrant/contacts.en.yml b/config/locales/registrant/contacts.en.yml new file mode 100644 index 000000000..0cb49130c --- /dev/null +++ b/config/locales/registrant/contacts.en.yml @@ -0,0 +1,17 @@ +en: + registrant: + contacts: + show: + general: + header: General + + address: + header: Address + + statuses: + header: Statuses + status: Status + notes: Note + + domains: + header: Domains \ No newline at end of file
<%= t(:status) %><%= t(:notes) %><%= t '.status' %><%= t '.notes' %>