diff options
author | Rémy Coutable <remy@rymai.me> | 2018-07-16 12:33:42 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-07-16 12:33:42 +0300 |
commit | f73fb2444985155c5bbec4fc43de9fbfb6710825 (patch) | |
tree | 239fa13eacafa3356d245cf0dbdc27a82a9f17d0 /app | |
parent | bda16c78223cd898f420debd2f025138eafc315a (diff) | |
parent | 926ba6e5fab25a1f4aaff18ca6d2a846e502d038 (diff) |
Merge branch 'i18n-extract-app/views/doorkeeper' into 'master'
i18n: externalize strings from 'app/views/doorkeeper'
See merge request gitlab-org/gitlab-ce!19695
Diffstat (limited to 'app')
11 files changed, 51 insertions, 60 deletions
diff --git a/app/views/doorkeeper/applications/_delete_form.html.haml b/app/views/doorkeeper/applications/_delete_form.html.haml index 84b4ce5b606..ac5cac50699 100644 --- a/app/views/doorkeeper/applications/_delete_form.html.haml +++ b/app/views/doorkeeper/applications/_delete_form.html.haml @@ -2,9 +2,9 @@ = form_tag oauth_application_path(application) do %input{ :name => "_method", :type => "hidden", :value => "delete" }/ - if defined? small - = button_tag type: "submit", class: "btn btn-transparent", data: { confirm: "Are you sure?" } do + = button_tag type: "submit", class: "btn btn-transparent", data: { confirm: _("Are you sure?") } do %span.sr-only - Destroy + = _('Destroy') = icon('trash') - else - = submit_tag 'Destroy', data: { confirm: "Are you sure?" }, class: submit_btn_css + = submit_tag _('Destroy'), data: { confirm: _("Are you sure?") }, class: submit_btn_css diff --git a/app/views/doorkeeper/applications/_form.html.haml b/app/views/doorkeeper/applications/_form.html.haml index be0935b8313..1ddd0df54cd 100644 --- a/app/views/doorkeeper/applications/_form.html.haml +++ b/app/views/doorkeeper/applications/_form.html.haml @@ -10,16 +10,14 @@ = f.text_area :redirect_uri, class: 'form-control', required: true %span.form-text.text-muted - Use one line per URI + = _('Use one line per URI') - if Doorkeeper.configuration.native_redirect_uri %span.form-text.text-muted - Use - %code= Doorkeeper.configuration.native_redirect_uri - for local tests + = _('Use <code>%{native_redirect_uri}</code> for local tests').html_safe % { native_redirect_uri: Doorkeeper.configuration.native_redirect_uri } .form-group = f.label :scopes, class: 'label-light' = render 'shared/tokens/scopes_form', prefix: 'doorkeeper_application', token: application, scopes: @scopes .prepend-top-default - = f.submit 'Save application', class: "btn btn-create" + = f.submit _('Save application'), class: "btn btn-create" diff --git a/app/views/doorkeeper/applications/edit.html.haml b/app/views/doorkeeper/applications/edit.html.haml index 49f90298a50..aad4200f240 100644 --- a/app/views/doorkeeper/applications/edit.html.haml +++ b/app/views/doorkeeper/applications/edit.html.haml @@ -1,4 +1,4 @@ -- page_title "Edit", @application.name, "Applications" +- page_title _("Edit"), @application.name, _("Applications") - @content_class = "limit-container-width" unless fluid_layout -%h3.page-title Edit application +%h3.page-title= _('Edit application') = render 'form', application: @application diff --git a/app/views/doorkeeper/applications/index.html.haml b/app/views/doorkeeper/applications/index.html.haml index cdf3ff81bd9..ab3a1b100ce 100644 --- a/app/views/doorkeeper/applications/index.html.haml +++ b/app/views/doorkeeper/applications/index.html.haml @@ -1,4 +1,4 @@ -- page_title "Applications" +- page_title _("Applications") - @content_class = "limit-container-width" unless fluid_layout .row.prepend-top-default @@ -7,28 +7,27 @@ = page_title %p - if user_oauth_applications? - Manage applications that can use GitLab as an OAuth provider, - and applications that you've authorized to use your account. + = _("Manage applications that can use GitLab as an OAuth provider, and applications that you've authorized to use your account.") - else - Manage applications that you've authorized to use your account. + = _("Manage applications that you've authorized to use your account.") .col-lg-8 - if user_oauth_applications? %h5.prepend-top-0 - Add new application + = _('Add new application') = render 'form', application: @application %hr - if user_oauth_applications? .oauth-applications %h5 - Your applications (#{@applications.size}) + = _("Your applications (%{size})") % { size: @applications.size } - if @applications.any? .table-responsive %table.table %thead %tr - %th Name - %th Callback URL - %th Clients + %th= _('Name') + %th= _('Callback URL') + %th= _('Clients') %th.last-heading %tbody - @applications.each do |application| @@ -41,25 +40,25 @@ %td = link_to edit_oauth_application_path(application), class: "btn btn-transparent append-right-5" do %span.sr-only - Edit + = _('Edit') = icon('pencil') = render 'delete_form', application: application, small: true - else .settings-message.text-center - You don't have any applications + = _("You don't have any applications") .oauth-authorized-applications.prepend-top-20.append-bottom-default - if user_oauth_applications? %h5 - Authorized applications (#{@authorized_tokens.size}) + = _("Authorized applications (%{size})") % { size: @authorized_tokens.size } - if @authorized_tokens.any? .table-responsive %table.table.table-striped %thead %tr - %th Name - %th Authorized At - %th Scope + %th= _('Name') + %th= _('Authorized At') + %th= _('Scope') %th %tbody - @authorized_apps.each do |app| @@ -72,12 +71,12 @@ - @authorized_anonymous_tokens.each do |token| %tr %td - Anonymous + = _('Anonymous') .form-text.text-muted - %em Authorization was granted by entering your username and password in the application. + %em= _("Authorization was granted by entering your username and password in the application.") %td= token.created_at %td= token.scopes %td= render 'doorkeeper/authorized_applications/delete_form', token: token - else .settings-message.text-center - You don't have any authorized applications + = _("You don't have any authorized applications") diff --git a/app/views/doorkeeper/applications/new.html.haml b/app/views/doorkeeper/applications/new.html.haml index d3692d1f759..a66fab20d7c 100644 --- a/app/views/doorkeeper/applications/new.html.haml +++ b/app/views/doorkeeper/applications/new.html.haml @@ -1,6 +1,6 @@ -- page_title "New Application" +- page_title _("New Application") -%h3.page-title New Application +%h3.page-title= _("New Application") %hr diff --git a/app/views/doorkeeper/applications/show.html.haml b/app/views/doorkeeper/applications/show.html.haml index 89ad626f73f..bb76ac6d5f6 100644 --- a/app/views/doorkeeper/applications/show.html.haml +++ b/app/views/doorkeeper/applications/show.html.haml @@ -1,27 +1,27 @@ -- add_to_breadcrumbs "Applications", oauth_applications_path +- add_to_breadcrumbs _("Applications"), oauth_applications_path - breadcrumb_title @application.name -- page_title @application.name, "Applications" +- page_title @application.name, _("Applications") - @content_class = "limit-container-width" unless fluid_layout %h3.page-title - Application: #{@application.name} + = _("Application: %{name}") % { name: @application.name } .table-holder.oauth-application-show %table.table %tr %td - Application Id + = _('Application Id') %td %code#application_id= @application.uid %tr %td - Secret: + = _('Secret:') %td %code#secret= @application.secret %tr %td - Callback url + = _('Callback url') %td - @application.redirect_uri.split.each do |uri| %div @@ -30,5 +30,5 @@ = render "shared/tokens/scopes_list", token: @application .form-actions - = link_to 'Edit', edit_oauth_application_path(@application), class: 'btn btn-primary wide float-left' + = link_to _('Edit'), edit_oauth_application_path(@application), class: 'btn btn-primary wide float-left' = render 'delete_form', application: @application, submit_btn_css: 'btn btn-danger prepend-left-10' diff --git a/app/views/doorkeeper/authorizations/error.html.haml b/app/views/doorkeeper/authorizations/error.html.haml index 6117b00149f..32b4ccb0fe6 100644 --- a/app/views/doorkeeper/authorizations/error.html.haml +++ b/app/views/doorkeeper/authorizations/error.html.haml @@ -1,3 +1,3 @@ -%h3.page-title An error has occurred +%h3.page-title= _("An error has occurred") %main{ :role => "main" } %pre= @pre_auth.error_response.body[:error_description] diff --git a/app/views/doorkeeper/authorizations/new.html.haml b/app/views/doorkeeper/authorizations/new.html.haml index 28cdc7607e0..ca62a59d909 100644 --- a/app/views/doorkeeper/authorizations/new.html.haml +++ b/app/views/doorkeeper/authorizations/new.html.haml @@ -3,34 +3,28 @@ .modal-content .modal-header %h3.page-title - Authorize - = link_to @pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer' - to use your account? + - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer') + = _("Authorize %{link_to_client} to use your account?") .modal-body - if current_user.admin? .text-warning %p = icon("exclamation-triangle fw") - You are an admin, which means granting access to - %strong= @pre_auth.client.name - will allow them to interact with GitLab as an admin as well. Proceed with caution. + = _('You are an admin, which means granting access to <strong>%{client_name}</strong> will allow them to interact with GitLab as an admin as well. Proceed with caution.').html_safe % { client_name: @pre_auth.client.name } %p - An application called - = link_to @pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer' - is requesting access to your GitLab account. + - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer') + = _("An application called %{link_to_client} is requesting access to your GitLab account.").html_safe % { link_to_client: link_to_client } - auth_app_owner = @pre_auth.client.application.owner - if auth_app_owner - This application was created by - = succeed "." do - = link_to auth_app_owner.name, user_path(auth_app_owner) + - link_to_owner = link_to(auth_app_owner.name, user_path(auth_app_owner)) + = _("This application was created by %{link_to_owner}.").html_safe % { link_to_owner: link_to_owner } - Please note that this application is not provided by GitLab and you should verify its authenticity before - allowing access. + = _("Please note that this application is not provided by GitLab and you should verify its authenticity before allowing access.") - if @pre_auth.scopes %p - This application will be able to: + = _("This application will be able to:") %ul - @pre_auth.scopes.each do |scope| %li @@ -44,7 +38,7 @@ = hidden_field_tag :response_type, @pre_auth.response_type = hidden_field_tag :scope, @pre_auth.scope = hidden_field_tag :nonce, @pre_auth.nonce - = submit_tag "Deny", class: "btn btn-danger" + = submit_tag _("Deny"), class: "btn btn-danger" = form_tag oauth_authorization_path, method: :post, class: 'inline' do = hidden_field_tag :client_id, @pre_auth.client.uid = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri @@ -52,4 +46,4 @@ = hidden_field_tag :response_type, @pre_auth.response_type = hidden_field_tag :scope, @pre_auth.scope = hidden_field_tag :nonce, @pre_auth.nonce - = submit_tag "Authorize", class: "btn btn-success prepend-left-10" + = submit_tag _("Authorize"), class: "btn btn-success prepend-left-10" diff --git a/app/views/doorkeeper/authorizations/show.html.haml b/app/views/doorkeeper/authorizations/show.html.haml index 44e868e6782..e4bfd69e7f8 100644 --- a/app/views/doorkeeper/authorizations/show.html.haml +++ b/app/views/doorkeeper/authorizations/show.html.haml @@ -1,3 +1,3 @@ -%h3.page-title Authorization code: +%h3.page-title= _("Authorization code:") %main{ :role => "main" } %code#authorization_code= params[:code] diff --git a/app/views/doorkeeper/authorized_applications/_delete_form.html.haml b/app/views/doorkeeper/authorized_applications/_delete_form.html.haml index 11c1e67878e..08f2442f025 100644 --- a/app/views/doorkeeper/authorized_applications/_delete_form.html.haml +++ b/app/views/doorkeeper/authorized_applications/_delete_form.html.haml @@ -6,4 +6,4 @@ = form_tag path do %input{ :name => "_method", :type => "hidden", :value => "delete" }/ - = submit_tag 'Revoke', onclick: "return confirm('Are you sure?')", class: 'btn btn-remove btn-sm' + = submit_tag _('Revoke'), onclick: "return confirm('#{_('Are you sure?')}')", class: 'btn btn-remove btn-sm' diff --git a/app/views/doorkeeper/authorized_applications/index.html.haml b/app/views/doorkeeper/authorized_applications/index.html.haml index 30c9d02b72e..8e73298b250 100644 --- a/app/views/doorkeeper/authorized_applications/index.html.haml +++ b/app/views/doorkeeper/authorized_applications/index.html.haml @@ -1,12 +1,12 @@ %header - %h1 Your authorized applications + %h1= _("Your authorized applications") %main{ :role => "main" } .table-holder %table.table.table-striped %thead %tr - %th Application - %th Created At + %th= _('Application') + %th= _('Created At') %th %th %tbody |