From 05ca540161a4f4c69cae870ab908ee98a156cbe2 Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Thu, 14 Jun 2018 17:45:01 +1000 Subject: [PATCH] i18n: externalize strings from 'app/views/projects/issues' Signed-off-by: Tao Wang --- .../issues/_by_email_description.html.haml | 9 ++-- .../projects/issues/_closed_by_box.html.haml | 4 +- .../projects/issues/_discussion.html.haml | 4 +- app/views/projects/issues/_issue.html.haml | 2 +- .../projects/issues/_merge_requests.html.haml | 6 +-- app/views/projects/issues/_nav_btns.html.haml | 6 +-- .../projects/issues/_new_branch.html.haml | 4 +- .../issues/_related_branches.html.haml | 2 +- app/views/projects/issues/edit.html.haml | 4 +- app/views/projects/issues/index.html.haml | 4 +- app/views/projects/issues/new.html.haml | 6 +-- app/views/projects/issues/show.html.haml | 27 +++++----- locale/gitlab.pot | 52 +++++++++++++++++++ 13 files changed, 90 insertions(+), 40 deletions(-) diff --git a/app/views/projects/issues/_by_email_description.html.haml b/app/views/projects/issues/_by_email_description.html.haml index f2d58534903ca6..71a9bbdf7ab8e5 100644 --- a/app/views/projects/issues/_by_email_description.html.haml +++ b/app/views/projects/issues/_by_email_description.html.haml @@ -1,6 +1,5 @@ -The subject will be used as the title of the new issue, and the message will be the description. += _("The subject will be used as the title of the new issue, and the message will be the description.") -= link_to 'Quick actions', help_page_path('user/project/quick_actions'), target: '_blank', tabindex: -1 -and styling with -= link_to 'Markdown', help_page_path('user/markdown'), target: '_blank', tabindex: -1 -are supported. +- link_to_quick_action = link_to(_('Quick actions'), help_page_path('user/project/quick_actions'), target: '_blank', tabindex: -1) +- link_to_markdown = link_to(_('Markdown'), help_page_path('user/markdown'), target: '_blank', tabindex: -1) += _("%{link_to_quick_action} and styling with %{link_to_markdown} are supported.").html_safe % { link_to_quick_action: link_to_quick_action, link_to_markdown: link_to_markdown } diff --git a/app/views/projects/issues/_closed_by_box.html.haml b/app/views/projects/issues/_closed_by_box.html.haml index 38469ed4774c95..08f95cf3b82236 100644 --- a/app/views/projects/issues/_closed_by_box.html.haml +++ b/app/views/projects/issues/_closed_by_box.html.haml @@ -1,4 +1,2 @@ .issue-closed-by-widget.second-block - - pluralized_mr_this = merge_request_count > 1 ? "these" : "this" - - pluralized_mr_is = merge_request_count > 1 ? "are" : "is" - When #{pluralized_mr_this} merge #{"request".pluralize(merge_request_count)} #{pluralized_mr_is} accepted, this issue will be closed automatically. + = n_("When this merge request is accepted, this issue will be closed automatically.", "When these merge requests are accepted, this issue will be closed automatically.", merge_request_count) diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 665968a64e1cf7..e11827563f6df1 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -2,8 +2,8 @@ - content_for :note_actions do - if can?(current_user, :update_issue, @issue) - = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' - = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' + = link_to _('Reopen issue'), issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: _("Reopen issue"), alternative_text: _("Comment & reopen issue")}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: _('Reopen issue') + = link_to _('Close issue'), issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: _("Close issue"), alternative_text: _("Comment & close issue")}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: _('Close issue') %section.js-vue-notes-event #js-vue-notes{ data: { notes_data: notes_data(@issue), diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index 171bf431b5297e..0cb4168b65a453 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -49,7 +49,7 @@ %ul.controls - if issue.closed? %li.issuable-status - CLOSED + = _("CLOSED") - if issue.assignees.any? %li = render 'shared/issuable/assignees', project: @project, issue: issue diff --git a/app/views/projects/issues/_merge_requests.html.haml b/app/views/projects/issues/_merge_requests.html.haml index 5c36d2202a6680..f9aa5ab485113c 100644 --- a/app/views/projects/issues/_merge_requests.html.haml +++ b/app/views/projects/issues/_merge_requests.html.haml @@ -22,13 +22,13 @@ - if merge_request.merged? %span.merge-request-status.prepend-left-10.merged - Merged + = _("Merged") - elsif merge_request.closed? %span.merge-request-status.prepend-left-10.closed - Closed + = _("Closed") - else %span.merge-request-status.prepend-left-10.open - Open + = _("Open") - if @closed_by_merge_requests.present? %li diff --git a/app/views/projects/issues/_nav_btns.html.haml b/app/views/projects/issues/_nav_btns.html.haml index 3a6e52fd44610c..a1404524d8e77d 100644 --- a/app/views/projects/issues/_nav_btns.html.haml +++ b/app/views/projects/issues/_nav_btns.html.haml @@ -11,11 +11,11 @@ = render 'projects/issues/export_issues/button' - if @can_bulk_update - = button_tag "Edit issues", class: "btn btn-default append-right-10 js-bulk-update-toggle" + = button_tag _("Edit issues"), class: "btn btn-default append-right-10 js-bulk-update-toggle" - if show_new_issue_link?(@project) - = link_to "New issue", new_project_issue_path(@project, + = link_to _("New issue"), new_project_issue_path(@project, issue: { assignee_id: finder.assignee.try(:id), milestone_id: finder.milestones.first.try(:id) }), class: "btn btn-new", - title: "New issue", + title: _("New issue"), id: "new_issue_link" diff --git a/app/views/projects/issues/_new_branch.html.haml b/app/views/projects/issues/_new_branch.html.haml index a678cb6f058603..a7ac7fd5e0848f 100644 --- a/app/views/projects/issues/_new_branch.html.haml +++ b/app/views/projects/issues/_new_branch.html.haml @@ -1,7 +1,7 @@ - if can?(current_user, :push_code, @project) - can_create_merge_request = can?(current_user, :create_merge_request_in, @project) - data_action = can_create_merge_request ? 'create-mr' : 'create-branch' - - value = can_create_merge_request ? 'Create merge request' : 'Create branch' + - value = can_create_merge_request ? _('Create merge request') : _('Create branch') - can_create_path = can_create_branch_project_issue_path(@project, @issue) - create_mr_path = create_merge_request_project_issue_path(@project, @issue, branch_name: @issue.to_branch_name, ref: @project.default_branch) @@ -13,7 +13,7 @@ %button.btn.btn-grouped{ type: 'button', disabled: 'disabled' } = icon('spinner', class: 'fa-spin') %span.text - Checking branch availability… + = _("Checking branch availability…") .btn-group.available.hidden %button.btn.js-create-merge-request.btn-success.btn-inverted{ type: 'button', data: { action: data_action } } = value diff --git a/app/views/projects/issues/_related_branches.html.haml b/app/views/projects/issues/_related_branches.html.haml index 1df38db9fd474b..5c751b9c1e41eb 100644 --- a/app/views/projects/issues/_related_branches.html.haml +++ b/app/views/projects/issues/_related_branches.html.haml @@ -1,6 +1,6 @@ - if @related_branches.any? %h2.related-branches-title - = pluralize(@related_branches.count, 'Related Branch') + = n_("Related Branch", "Related Branches", @related_branches.count) %ul.unstyled-list.related-merge-requests - @related_branches.each do |branch| %li diff --git a/app/views/projects/issues/edit.html.haml b/app/views/projects/issues/edit.html.haml index 1b7d878c38c0db..60dd3501f2a4e4 100644 --- a/app/views/projects/issues/edit.html.haml +++ b/app/views/projects/issues/edit.html.haml @@ -1,7 +1,7 @@ -- page_title "Edit", "#{@issue.title} (#{@issue.to_reference})", "Issues" +- page_title _("Edit"), "#{@issue.title} (#{@issue.to_reference})", _("Issues") %h3.page-title - Edit Issue ##{@issue.iid} + = _("Edit Issue #%{id}") % { id: @issue.iid } %hr = render "form" diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index 8549f1e053930b..e627eca0e27c84 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -1,11 +1,11 @@ - @no_container = true - @can_bulk_update = can?(current_user, :admin_issue, @project) -- page_title "Issues" +- page_title _("Issues") - new_issue_email = @project.new_issuable_address(current_user, 'issue') = content_for :meta_tags do - = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@project.name} issues") + = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: _("%{project_name} issues") % { project_name: @project.name }) - if project_issues(@project).exists? diff --git a/app/views/projects/issues/new.html.haml b/app/views/projects/issues/new.html.haml index 60fe442014fa79..52721f428d9e20 100644 --- a/app/views/projects/issues/new.html.haml +++ b/app/views/projects/issues/new.html.haml @@ -1,8 +1,8 @@ -- breadcrumb_title "Issues" -- page_title "New Issue" +- breadcrumb_title _("Issues") +- page_title _("New Issue") %h3.page-title - New Issue + = _("New Issue") %hr = render "form" diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index e0f3946ad06f1f..807bc334139d1a 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -1,7 +1,7 @@ - @content_class = "limit-container-width" unless fluid_layout -- add_to_breadcrumbs "Issues", project_issues_path(@project) +- add_to_breadcrumbs _("Issues"), project_issues_path(@project) - breadcrumb_title @issue.to_reference -- page_title "#{@issue.title} (#{@issue.to_reference})", "Issues" +- page_title "#{@issue.title} (#{@issue.to_reference})", _("Issues") - page_description @issue.description - page_card_attributes @issue.card_attributes @@ -14,10 +14,11 @@ .issuable-status-box.status-box.status-box-issue-closed{ class: issue_button_visibility(@issue, false) } = sprite_icon('mobile-issue-close', size: 16, css_class: 'd-block d-sm-none') %span.d-none.d-sm-block - Closed + = _("Closed") .issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) } = sprite_icon('issue-open-m', size: 16, css_class: 'd-block d-sm-none') - %span.d-none.d-sm-block Open + %span.d-none.d-sm-block + = _("Open") .issuable-meta - if @issue.confidential @@ -32,29 +33,29 @@ .detail-page-header-actions.js-issuable-actions .clearfix.issue-btn-group.dropdown %button.btn.btn-default.float-left.d-md-none.d-lg-none.d-xl-none{ type: "button", data: { toggle: "dropdown" } } - Options + = _("Options") = icon('caret-down') .dropdown-menu.dropdown-menu-right.d-lg-none.d-xl-none %ul - unless current_user == @issue.author - %li= link_to 'Report abuse', new_abuse_report_path(user_id: @issue.author.id, ref_url: issue_url(@issue)) + %li= link_to _('Report abuse'), new_abuse_report_path(user_id: @issue.author.id, ref_url: issue_url(@issue)) - if can_update_issue - %li= link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, format: 'json'), class: "btn-close js-btn-issue-action #{issue_button_visibility(@issue, true)}", title: 'Close issue' - %li= link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), class: "btn-reopen js-btn-issue-action #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' + %li= link_to _('Close issue'), issue_path(@issue, issue: { state_event: :close }, format: 'json'), class: "btn-close js-btn-issue-action #{issue_button_visibility(@issue, true)}", title: _('Close issue') + %li= link_to _('Reopen issue'), issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), class: "btn-reopen js-btn-issue-action #{issue_button_visibility(@issue, false)}", title: _('Reopen issue') - if can_report_spam - %li= link_to 'Submit as spam', mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'btn-spam', title: 'Submit as spam' + %li= link_to _('Submit as spam'), mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'btn-spam', title: _('Submit as spam') - if can_create_issue - if can_update_issue || can_report_spam %li.divider - %li= link_to 'New issue', new_project_issue_path(@project), title: 'New issue', id: 'new_issue_link' + %li= link_to _('New issue'), new_project_issue_path(@project), title: _('New issue'), id: 'new_issue_link' = render 'shared/issuable/close_reopen_button', issuable: @issue, can_update: can_update_issue - if can_report_spam - = link_to 'Submit as spam', mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'd-none d-sm-none d-md-block btn btn-grouped btn-spam', title: 'Submit as spam' + = link_to _('Submit as spam'), mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'd-none d-sm-none d-md-block btn btn-grouped btn-spam', title: _('Submit as spam') - if can_create_issue - = link_to new_project_issue_path(@project), class: 'd-none d-sm-none d-md-block btn btn-grouped new-issue-link btn-new btn-inverted', title: 'New issue', id: 'new_issue_link' do - New issue + = link_to new_project_issue_path(@project), class: 'd-none d-sm-none d-md-block btn btn-grouped new-issue-link btn-new btn-inverted', title: _('New issue'), id: 'new_issue_link' do + = _("New issue") .issue-details.issuable-details .detail-page-description.content-block diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 0ea8789d6cbfc5..14cca11f38e985 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -122,6 +122,9 @@ msgstr "" msgid "%{group_docs_link_start}Groups%{group_docs_link_end} allow you to manage and collaborate across multiple projects. Members of a group have access to all of its projects." msgstr "" +msgid "%{link_to_quick_action} and styling with %{link_to_markdown} are supported." +msgstr "" + msgid "%{loadingIcon} Started" msgstr "" @@ -149,6 +152,9 @@ msgstr "" msgid "%{percent}%% complete" msgstr "" +msgid "%{project_name} issues" +msgstr "" + msgid "%{storage_name}: failed storage access attempt on host:" msgid_plural "%{storage_name}: %{failed_attempts} failed storage access attempts:" msgstr[0] "" @@ -1286,6 +1292,9 @@ msgstr "" msgid "CICD|instance enabled" msgstr "" +msgid "CLOSED" +msgstr "" + msgid "Callback URL" msgstr "" @@ -1355,6 +1364,9 @@ msgstr "" msgid "Checking branch availability..." msgstr "" +msgid "Checking branch availability…" +msgstr "" + msgid "Cherry-pick this commit" msgstr "" @@ -1535,6 +1547,9 @@ msgstr "" msgid "Close" msgstr "" +msgid "Close issue" +msgstr "" + msgid "Closed" msgstr "" @@ -1946,6 +1961,12 @@ msgstr "" msgid "Collapse sidebar" msgstr "" +msgid "Comment & close issue" +msgstr "" + +msgid "Comment & reopen issue" +msgstr "" + msgid "Comment & resolve discussion" msgstr "" @@ -2687,6 +2708,9 @@ msgstr "" msgid "Edit" msgstr "" +msgid "Edit Issue #%{id}" +msgstr "" + msgid "Edit Label" msgstr "" @@ -2708,6 +2732,9 @@ msgstr "" msgid "Edit identity for %{user_name}" msgstr "" +msgid "Edit issues" +msgstr "" + msgid "Elasticsearch" msgstr "" @@ -4341,6 +4368,9 @@ msgstr "" msgid "Mark todo as done" msgstr "" +msgid "Markdown" +msgstr "" + msgid "Markdown enabled" msgstr "" @@ -5731,6 +5761,9 @@ msgstr "" msgid "Quarters" msgstr "" +msgid "Quick actions" +msgstr "" + msgid "Quick actions can be used in the issues description and comment boxes." msgstr "" @@ -5772,6 +5805,11 @@ msgstr "" msgid "Registry" msgstr "" +msgid "Related Branch" +msgid_plural "Related Branches" +msgstr[0] "" +msgstr[1] "" + msgid "Related Commits" msgstr "" @@ -5820,6 +5858,9 @@ msgstr "" msgid "Rename folder" msgstr "" +msgid "Reopen issue" +msgstr "" + msgid "Repair authentication" msgstr "" @@ -5829,6 +5870,9 @@ msgstr "" msgid "Repo by URL" msgstr "" +msgid "Report abuse" +msgstr "" + msgid "Reports|%{failedString} and %{resolvedString}" msgstr "" @@ -6806,6 +6850,9 @@ msgstr "" msgid "The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time." msgstr "" +msgid "The subject will be used as the title of the new issue, and the message will be the description." +msgstr "" + msgid "The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running." msgstr "" @@ -7554,6 +7601,11 @@ msgstr "" msgid "When leaving the URL blank, classification labels can still be specified without disabling cross project features or performing external authorization checks." msgstr "" +msgid "When this merge request is accepted, this issue will be closed automatically." +msgid_plural "When these merge requests are accepted, this issue will be closed automatically." +msgstr[0] "" +msgstr[1] "" + msgid "Wiki" msgstr "" -- GitLab