From 7fbd92294612d6f9178c92625e7f359e4ef9e25f Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Mon, 20 Aug 2018 10:51:31 +0200 Subject: [PATCH] add i18n support to admin runners page --- app/views/admin/runners/_runner.html.haml | 30 +++++----- app/views/admin/runners/index.html.haml | 70 ++++++++++++----------- locale/gitlab.pot | 48 ++++++++++++++++ 3 files changed, 100 insertions(+), 48 deletions(-) diff --git a/app/views/admin/runners/_runner.html.haml b/app/views/admin/runners/_runner.html.haml index 7d4cf4d32c3..95dccbc9841 100644 --- a/app/views/admin/runners/_runner.html.haml +++ b/app/views/admin/runners/_runner.html.haml @@ -1,6 +1,6 @@ .gl-responsive-table-row{ id: dom_id(runner) } .table-section.section-10 - .table-mobile-header{ role: "rowheader" } Type + .table-mobile-header{ role: 'rowheader' }= _('Type') .table-mobile-content - if runner.instance_type? %span.badge.badge-success shared @@ -14,65 +14,65 @@ %span.badge.badge-danger paused .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Runner token + .table-mobile-header{ role: 'rowheader' }= _('Runner token') .table-mobile-content = link_to runner.short_sha, admin_runner_path(runner) .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Description + .table-mobile-header{ role: 'rowheader' }= _('Description') .table-mobile-content = runner.description .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Version + .table-mobile-header{ role: 'rowheader' }= _('Version') .table-mobile-content = runner.version .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } IP Address + .table-mobile-header{ role: 'rowheader' }= _('IP Address') .table-mobile-content = runner.ip_address .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Projects + .table-mobile-header{ role: 'rowheader' }= _('Projects') .table-mobile-content - if runner.instance_type? || runner.group_type? - n/a + = _('n/a') - else = runner.projects.count(:all) .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Jobs + .table-mobile-header{ role: 'rowheader' }= _('Jobs') .table-mobile-content = runner.builds.count(:all) .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Tags + .table-mobile-header{ role: 'rowheader' }= _('Tags') .table-mobile-content - runner.tag_list.sort.each do |tag| %span.badge.badge-primary = tag .table-section.section-10 - .table-mobile-header{ role: 'rowheader' } Last contact + .table-mobile-header{ role: 'rowheader' }= _('Last contact') .table-mobile-content - if runner.contacted_at = time_ago_with_tooltip runner.contacted_at - else - Never + = _('Never') .table-section.table-button-footer.section-10 .btn-group.table-action-buttons .btn-group - = link_to admin_runner_path(runner), class: 'btn btn-default has-tooltip', title: 'Edit', ref: 'tooltip', aria: { label: 'Edit' }, data: { placement: 'top', container: 'body'} do + = link_to admin_runner_path(runner), class: 'btn btn-default has-tooltip', title: _('Edit'), ref: 'tooltip', aria: { label: _('Edit') }, data: { placement: 'top', container: 'body'} do = icon('pencil') .btn-group - if runner.active? - = link_to [:pause, :admin, runner], method: :get, class: 'btn btn-default has-tooltip', title: 'Pause', ref: 'tooltip', aria: { label: 'Pause' }, data: { placement: 'top', container: 'body', confirm: "Are you sure?" } do + = link_to [:pause, :admin, runner], method: :get, class: 'btn btn-default has-tooltip', title: _('Pause'), ref: 'tooltip', aria: { label: _('Pause') }, data: { placement: 'top', container: 'body', confirm: _('Are you sure?') } do = icon('pause') - else - = link_to [:resume, :admin, runner], method: :get, class: 'btn btn-default has-tooltip', title: 'Resume', ref: 'tooltip', aria: { label: 'Resume' }, data: { placement: 'top', container: 'body'} do + = link_to [:resume, :admin, runner], method: :get, class: 'btn btn-default has-tooltip', title: _('Resume'), ref: 'tooltip', aria: { label: _('Resume') }, data: { placement: 'top', container: 'body'} do = icon('play') .btn-group - = link_to [:admin, runner], method: :delete, class: 'btn btn-danger has-tooltip', title: 'Remove', ref: 'tooltip', aria: { label: 'Remove' }, data: { placement: 'top', container: 'body', confirm: "Are you sure?" } do + = link_to [:admin, runner], method: :delete, class: 'btn btn-danger has-tooltip', title: _('Remove'), ref: 'tooltip', aria: { label: _('Remove') }, data: { placement: 'top', container: 'body', confirm: _('Are you sure?') } do = icon('remove') diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml index 4078c37df6d..3a678a58e5c 100644 --- a/app/views/admin/runners/index.html.haml +++ b/app/views/admin/runners/index.html.haml @@ -1,73 +1,77 @@ -- breadcrumb_title "Runners" +- breadcrumb_title _('Runners') - @no_container = true %div{ class: container_class } .bs-callout %p - A 'Runner' is a process which runs a job. - You can setup as many Runners as you need. + = (_"A 'Runner' is a process which runs a job. You can setup as many Runners as you need.") %br - Runners can be placed on separate users, servers, even on your local machine. + = _('Runners can be placed on separate users, servers, even on your local machine.') %br %div - %span Each Runner can be in one of the following states: + %span= _('Each Runner can be in one of the following states:') %ul %li %span.badge.badge-success shared - \- Runner runs jobs from all unassigned projects + \- + = _('Runner runs jobs from all unassigned projects') %li %span.badge.badge-success group - \- Runner runs jobs from all unassigned projects in its group + \- + = _('Runner runs jobs from all unassigned projects in its group') %li %span.badge.badge-info specific - \- Runner runs jobs from assigned projects + \- + = _('Runner runs jobs from assigned projects') %li %span.badge.badge-warning locked - \- Runner cannot be assigned to other projects + \- + = _('Runner cannot be assigned to other projects') %li %span.badge.badge-danger paused - \- Runner will not receive any new jobs + \- + = _('Runner will not receive any new jobs') .bs-callout.clearfix .float-left %p - You can reset runners registration token by pressing a button below. + = _('You can reset runners registration token by pressing a button below.') .prepend-top-10 - = button_to _("Reset runners registration token"), reset_runners_token_admin_application_settings_path, + = button_to _('Reset runners registration token'), reset_runners_token_admin_application_settings_path, method: :put, class: 'btn btn-default', - data: { confirm: _("Are you sure you want to reset registration token?") } + data: { confirm: _('Are you sure you want to reset registration token?') } = render partial: 'ci/runner/how_to_setup_shared_runner', locals: { registration_token: Gitlab::CurrentSettings.runners_registration_token } .bs-callout %p - Runners currently online: #{@active_runners_cnt} + = _('Runners currently online: %{active_runners_cnt}') % { active_runners_cnt: @active_runners_cnt } .row-content-block.second-block = form_tag admin_runners_path, id: 'runners-search', method: :get, class: 'filter-form js-filter-form' do .filtered-search-wrapper .filtered-search-box = dropdown_tag(custom_icon('icon_history'), - options: { wrapper_class: "filtered-search-history-dropdown-wrapper", - toggle_class: "filtered-search-history-dropdown-toggle-button", - dropdown_class: "filtered-search-history-dropdown", - content_class: "filtered-search-history-dropdown-content", - title: "Recent searches" }) do + options: { wrapper_class: 'filtered-search-history-dropdown-wrapper', + toggle_class: 'filtered-search-history-dropdown-toggle-button', + dropdown_class: 'filtered-search-history-dropdown', + content_class: 'filtered-search-history-dropdown-content', + title: _('Recent searches') }) do .js-filtered-search-history-dropdown{ data: { full_path: admin_runners_path } } .filtered-search-box-input-container.droplab-dropdown .scroll-container %ul.tokens-container.list-unstyled %li.input-token - %input.form-control.filtered-search{ { id: 'filtered-search-runners', placeholder: 'Search or filter results...' } } + %input.form-control.filtered-search{ { id: 'filtered-search-runners', placeholder: _('Search or filter results...') } } #js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { action: 'submit' } } = button_tag class: %w[btn btn-link] do = icon('search') %span - Press Enter or click to search + = _('Press Enter or click to search') %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } %li.filter-dropdown-item = button_tag class: %w[btn btn-link] do @@ -93,18 +97,18 @@ .runners-content.content-list .table-holder .gl-responsive-table-row.table-row-header{ role: 'row' } - .table-section.section-10{ role: 'rowheader' } Type - .table-section.section-10{ role: 'rowheader' } Runner token - .table-section.section-10{ role: 'rowheader' } Description - .table-section.section-10{ role: 'rowheader' } Version - .table-section.section-10{ role: 'rowheader' } IP Address - .table-section.section-10{ role: 'rowheader' } Projects - .table-section.section-10{ role: 'rowheader' } Jobs - .table-section.section-10{ role: 'rowheader' } Tags - .table-section.section-10{ role: 'rowheader' } Last contact + .table-section.section-10{ role: 'rowheader' }= _('Type') + .table-section.section-10{ role: 'rowheader' }= _('Runner token') + .table-section.section-10{ role: 'rowheader' }= _('Description') + .table-section.section-10{ role: 'rowheader' }= _('Version') + .table-section.section-10{ role: 'rowheader' }= _('IP Address') + .table-section.section-10{ role: 'rowheader' }= _('Projects') + .table-section.section-10{ role: 'rowheader' }= _('Jobs') + .table-section.section-10{ role: 'rowheader' }= _('Tags') + .table-section.section-10{ role: 'rowheader' }= _('Last contact') - @runners.each do |runner| - = render "admin/runners/runner", runner: runner - = paginate @runners, theme: "gitlab" + = render 'admin/runners/runner', runner: runner + = paginate @runners, theme: 'gitlab' - else - .nothing-here-block No runners found + .nothing-here-block= _('No runners found') diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 7afdea46fe3..029fd2ae132 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -3345,6 +3345,9 @@ msgstr "" msgid "Last commit" msgstr "" +msgid "Last contact" +msgstr "" + msgid "Last edited %{date}" msgstr "" @@ -3850,6 +3853,9 @@ msgstr "" msgid "No repository" msgstr "" +msgid "No runners found" +msgstr "" + msgid "No schedules" msgstr "" @@ -4308,6 +4314,9 @@ msgstr "" msgid "Preferences|Navigation theme" msgstr "" +msgid "Press Enter or click to search" +msgstr "" + msgid "Preview" msgstr "" @@ -4644,6 +4653,9 @@ msgstr "" msgid "Real-time features" msgstr "" +msgid "Recent searches" +msgstr "" + msgid "Reference:" msgstr "" @@ -4828,9 +4840,24 @@ msgstr "" msgid "Run untagged jobs" msgstr "" +msgid "Runner cannot be assigned to other projects" +msgstr "" + +msgid "Runner runs jobs from all unassigned projects" +msgstr "" + +msgid "Runner runs jobs from all unassigned projects in its group" +msgstr "" + +msgid "Runner runs jobs from assigned projects" +msgstr "" + msgid "Runner token" msgstr "" +msgid "Runner will not receive any new jobs" +msgstr "" + msgid "Runners" msgstr "" @@ -4840,6 +4867,12 @@ msgstr "" msgid "Runners can be placed on separate users, servers, and even on your local machine." msgstr "" +msgid "Runners can be placed on separate users, servers, even on your local machine." +msgstr "" + +msgid "Runners currently online: %{active_runners_cnt}" +msgstr "" + msgid "Runners page" msgstr "" @@ -4912,6 +4945,9 @@ msgstr "" msgid "Search milestones" msgstr "" +msgid "Search or filter results..." +msgstr "" + msgid "Search or jump to…" msgstr "" @@ -5982,6 +6018,9 @@ msgstr "" msgid "Twitter" msgstr "" +msgid "Type" +msgstr "" + msgid "Unable to load the diff. %{button_try_again}" msgstr "" @@ -6114,6 +6153,9 @@ msgstr "" msgid "Verified" msgstr "" +msgid "Version" +msgstr "" + msgid "View file @ " msgstr "" @@ -6378,6 +6420,9 @@ msgstr "" msgid "You can only edit files when you are on a branch" msgstr "" +msgid "You can reset runners registration token by pressing a button below." +msgstr "" + msgid "You can resolve the merge conflict using either the Interactive mode, by choosing %{use_ours} or %{use_theirs} buttons, or by editing the files directly. Commit these changes into %{branch_name}" msgstr "" @@ -6745,6 +6790,9 @@ msgstr "" msgid "mrWidget|to be merged automatically when the pipeline succeeds" msgstr "" +msgid "n/a" +msgstr "" + msgid "new merge request" msgstr ""