From 726f5bbf04b92357a11af34044a0720092797a71 Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Mon, 2 Apr 2018 10:57:44 -0500 Subject: [PATCH] Fix i18n on deploy_token views --- .../projects/settings/deploy_tokens_presenter.rb | 4 ++-- app/views/projects/deploy_tokens/_form.html.haml | 4 ++-- app/views/projects/deploy_tokens/_index.html.haml | 6 +++--- .../deploy_tokens/_new_deploy_token.html.haml | 6 +++--- .../projects/deploy_tokens/_revoke_modal.html.haml | 14 +++++++------- app/views/projects/deploy_tokens/_table.html.haml | 14 +++++++------- .../projects/registry/repositories/index.html.haml | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/presenters/projects/settings/deploy_tokens_presenter.rb b/app/presenters/projects/settings/deploy_tokens_presenter.rb index c212a1766b2..e2aca2d273a 100644 --- a/app/presenters/projects/settings/deploy_tokens_presenter.rb +++ b/app/presenters/projects/settings/deploy_tokens_presenter.rb @@ -44,8 +44,8 @@ module Projects def scope_descriptions { - 'read_repo' => s_('Allows read-only access to the repository'), - 'read_registry' => s_('Allows read-only access to the registry images') + 'read_repo' => s_('DeployTokens|Allows read-only access to the repository'), + 'read_registry' => s_('DeployTokens|Allows read-only access to the registry images') } end diff --git a/app/views/projects/deploy_tokens/_form.html.haml b/app/views/projects/deploy_tokens/_form.html.haml index 28514a74f25..001afcf1944 100644 --- a/app/views/projects/deploy_tokens/_form.html.haml +++ b/app/views/projects/deploy_tokens/_form.html.haml @@ -1,5 +1,5 @@ %p.profile-settings-content - = s_("Pick a name for the application, and we'll give you a unique deploy token.") + = s_("DeployTokens|Pick a name for the application, and we'll give you a unique deploy token.") = form_for token, url: project_deploy_tokens_path(project), method: :post do |f| = form_errors(token) @@ -18,4 +18,4 @@ = render 'projects/deploy_tokens/scope_form', token: token, scope: scope, presenter: presenter .prepend-top-default - = f.submit s_('Create deploy token'), class: 'btn btn-success' + = f.submit s_('DeployTokens|Create deploy token'), class: 'btn btn-success' diff --git a/app/views/projects/deploy_tokens/_index.html.haml b/app/views/projects/deploy_tokens/_index.html.haml index 8e527dce306..2ef9d1fb4a4 100644 --- a/app/views/projects/deploy_tokens/_index.html.haml +++ b/app/views/projects/deploy_tokens/_index.html.haml @@ -2,17 +2,17 @@ %section.settings.no-animate{ class: ('expanded' if expanded) } .settings-header - %h4= s_('Deploy Tokens') + %h4= s_('DeployTokens|Deploy Tokens') %button.btn.js-settings-toggle.qa-expand-deploy-keys{ type: 'button' } = expanded ? 'Collapse' : 'Expand' %p - = s_('Deploy tokens allow read-only access to your repository and registry images.') + = s_('DeployTokens|Deploy tokens allow read-only access to your repository and registry images.') .settings-content - if @deploy_tokens.temporal_token = render 'projects/deploy_tokens/new_deploy_token', new_token: @deploy_tokens.temporal_token %h5.prepend-top-0 - = s_('Add a deploy token') + = s_('DeployTokens|Add a deploy token') = render 'projects/deploy_tokens/form', project: @project, token: @deploy_token, presenter: @deploy_tokens %hr = render 'projects/deploy_tokens/table', project: @project, active_tokens: @deploy_tokens diff --git a/app/views/projects/deploy_tokens/_new_deploy_token.html.haml b/app/views/projects/deploy_tokens/_new_deploy_token.html.haml index 31b3f0e7d18..a701817ddab 100644 --- a/app/views/projects/deploy_tokens/_new_deploy_token.html.haml +++ b/app/views/projects/deploy_tokens/_new_deploy_token.html.haml @@ -1,9 +1,9 @@ .created-deploy-token-container %h5.prepend-top-0 - = s_('Your New Deploy Token') + = s_('DeployTokens|Your New Deploy Token') .form-group = text_field_tag 'deploy-token', new_token, readonly: true, class: 'deploy-token-field form-control js-select-on-focus' - = clipboard_button(text: new_token, title: s_('Copy deploy token to clipboard'), placement: 'left') - %span.deploy-token-help-block.prepend-top-5.text-danger= s_("Make sure you save it - you won't be able to access it again.") + = clipboard_button(text: new_token, title: s_('DeployTokens|Copy deploy token to clipboard'), placement: 'left') + %span.deploy-token-help-block.prepend-top-5.text-danger= s_("DeployTokens|Make sure you save it - you won't be able to access it again.") %hr diff --git a/app/views/projects/deploy_tokens/_revoke_modal.html.haml b/app/views/projects/deploy_tokens/_revoke_modal.html.haml index 6e043a72b60..085964fe22e 100644 --- a/app/views/projects/deploy_tokens/_revoke_modal.html.haml +++ b/app/views/projects/deploy_tokens/_revoke_modal.html.haml @@ -3,15 +3,15 @@ .modal-content .modal-header %h4.modal-title.pull-left - Revoke + = s_('DeployTokens|Revoke') %b #{token.name}? - %button.close{ 'aria-label' => 'Close', 'data-dismiss' => 'modal', type: 'button' } - %span{ 'aria-hidden' => 'true' } × + %button.close{ 'aria-label' => _('Close'), 'data-dismiss' => 'modal', type: 'button' } + %span{ 'aria-hidden' => 'true' } × .modal-body %p - = s_('You are about to revoke') + = s_('DeployTokens|You are about to revoke') %b #{token.name}. - = s_('This action cannot be undone.') + = s_('DeployTokens|This action cannot be undone.') .modal-footer - %a{ href: '#', data: { dismiss: 'modal' }, class: 'btn btn-default' }= s_('Cancel') - = link_to "Revoke #{token.name}", revoke_project_deploy_token_path(project, token), method: :put, class: 'btn btn-danger' + %a{ href: '#', data: { dismiss: 'modal' }, class: 'btn btn-default' }= _('Cancel') + = link_to s_('DeployTokens|Revoke %{name}') % { name: token.name }, revoke_project_deploy_token_path(project, token), method: :put, class: 'btn btn-danger' diff --git a/app/views/projects/deploy_tokens/_table.html.haml b/app/views/projects/deploy_tokens/_table.html.haml index 5ea9e86020f..7ef135df0f6 100644 --- a/app/views/projects/deploy_tokens/_table.html.haml +++ b/app/views/projects/deploy_tokens/_table.html.haml @@ -1,14 +1,14 @@ -%h5 Active Deploy Tokens (#{active_tokens.length}) +%h5= s_("DeployTokens|Active Deploy Tokens (%{active_tokens})") % { active_tokens: active_tokens.length } - if active_tokens.present? .table-responsive.deploy-tokens %table.table %thead %tr - %th Name - %th Created - %th Expires - %th Scopes + %th= s_('DeployTokens|Name') + %th= s_('DeployTokens|Created') + %th= s_('DeployTokens|Expires') + %th= s_('DeployTokens|Scopes') %th %tbody - active_tokens.each do |token| @@ -22,8 +22,8 @@ - else %span.token-never-expires-label Never %td= token.scopes.present? ? token.scopes.join(", ") : "" - %td= link_to "Revoke", "#", class: "btn btn-danger pull-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"} + %td= link_to s_('DeployTokens|Revoke'), "#", class: "btn btn-danger pull-right", data: { toggle: "modal", target: "#revoke-modal-#{token.id}"} = render 'projects/deploy_tokens/revoke_modal', token: token, project: project - else .settings-message.text-center - This project has no active Deploy Tokens. + = s_('DeployTokens|This project has no active Deploy Tokens.') diff --git a/app/views/projects/registry/repositories/index.html.haml b/app/views/projects/registry/repositories/index.html.haml index b4457ea63ee..2c80f7c3fa3 100644 --- a/app/views/projects/registry/repositories/index.html.haml +++ b/app/views/projects/registry/repositories/index.html.haml @@ -30,7 +30,7 @@ %br %p - deploy_token = link_to(_('deploy token'), help_page_path('user/projects/deploy_tokens/index', anchor: 'read-container-registry-images'), target: '_blank') - = s_('Container-Registry|You can also %{deploy_token} for read-only access to the registry images.').html_safe % { deploy_token: deploy_token } + = s_('ContainerRegistry|You can also %{deploy_token} for read-only access to the registry images.').html_safe % { deploy_token: deploy_token } %br %p = s_('ContainerRegistry|Once you log in, you’re free to create and upload a container image using the common %{build} and %{push} commands').html_safe % { build: "build".html_safe, push: "push".html_safe }