mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Fix i18n
This commit is contained in:
parent
3979fc5f8f
commit
489cd2f7e5
4 changed files with 23 additions and 11 deletions
|
@ -26,19 +26,11 @@ class Registrar
|
|||
|
||||
private
|
||||
|
||||
def process_response(response:, start_notice: "", active_tab:)
|
||||
def process_response(response:, start_notice: '', active_tab:)
|
||||
parsed_response = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
if response.code == '200'
|
||||
notices = [start_notice]
|
||||
|
||||
notices << "#{t('registrar.tech_contacts.process_request.affected_domains')}: " \
|
||||
"#{parsed_response[:data][:affected_domains].join(', ')}"
|
||||
|
||||
if parsed_response[:data][:skipped_domains]
|
||||
notices << "#{t('registrar.tech_contacts.process_request.skipped_domains')}: " \
|
||||
"#{parsed_response[:data][:skipped_domains].join(', ')}"
|
||||
end
|
||||
notices = success_notices(parsed_response, start_notice)
|
||||
|
||||
flash[:notice] = notices.join(', ')
|
||||
redirect_to registrar_domains_url
|
||||
|
@ -48,6 +40,19 @@ class Registrar
|
|||
end
|
||||
end
|
||||
|
||||
def success_notices(parsed_response, start_notice)
|
||||
notices = [start_notice]
|
||||
|
||||
notices << "#{t('.affected_domains')}: " \
|
||||
"#{parsed_response[:data][:affected_domains].join(', ')}"
|
||||
|
||||
if parsed_response[:data][:skipped_domains]
|
||||
notices << "#{t('.skipped_domains')}: " \
|
||||
"#{parsed_response[:data][:skipped_domains].join(', ')}"
|
||||
end
|
||||
notices
|
||||
end
|
||||
|
||||
def do_request(request, uri)
|
||||
response = if Rails.env.test?
|
||||
do_test_request(request, uri)
|
||||
|
|
|
@ -15,7 +15,7 @@ class Registrar
|
|||
|
||||
response = do_request(request, uri)
|
||||
|
||||
start_notice = t('registrar.tech_contacts.process_request.replaced')
|
||||
start_notice = t('.replaced')
|
||||
|
||||
process_response(response: response,
|
||||
start_notice: start_notice,
|
||||
|
|
|
@ -4,6 +4,7 @@ en:
|
|||
new:
|
||||
header: Bulk change
|
||||
technical_contact: Technical contact
|
||||
admin_contact: Admin contact
|
||||
nameserver: Nameserver
|
||||
bulk_transfer: Bulk transfer
|
||||
bulk_renew: Bulk renew
|
||||
|
@ -38,3 +39,5 @@ en:
|
|||
domain_ids: Domains for bulk renewal
|
||||
current_balance: Current balance
|
||||
period: Period
|
||||
affected_domains: Affected domains
|
||||
skipped_domains: Skipped domains
|
||||
|
|
|
@ -5,3 +5,7 @@ en:
|
|||
replaced: Technical contacts have been successfully replaced.
|
||||
affected_domains: Affected domains
|
||||
skipped_domains: Skipped domains
|
||||
process_request:
|
||||
affected_domains: Affected domains
|
||||
skipped_domains: Skipped domains
|
||||
replaced: Technical contacts have been successfully replaced.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue