From 9dfae2248de17d8e72cb305d7978865cd6a37098 Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Thu, 14 Jun 2018 19:19:12 +1000 Subject: [PATCH] i18n: externalize strings from 'app/views/projects/snippets' Signed-off-by: Tao Wang --- .../projects/snippets/_actions.html.haml | 26 +++++++++---------- app/views/projects/snippets/edit.html.haml | 6 ++--- app/views/projects/snippets/index.html.haml | 4 +-- app/views/projects/snippets/new.html.haml | 8 +++--- app/views/projects/snippets/show.html.haml | 4 +-- locale/gitlab.pot | 22 ++++++++++++++-- 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/app/views/projects/snippets/_actions.html.haml b/app/views/projects/snippets/_actions.html.haml index b3a9fa9dd91..4a3aa3dc626 100644 --- a/app/views/projects/snippets/_actions.html.haml +++ b/app/views/projects/snippets/_actions.html.haml @@ -3,34 +3,34 @@ .d-none.d-sm-block - if can?(current_user, :update_project_snippet, @snippet) = link_to edit_project_snippet_path(@project, @snippet), class: "btn btn-grouped" do - Edit + = _('Edit') - if can?(current_user, :update_project_snippet, @snippet) - = link_to project_snippet_path(@project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-grouped btn-inverted btn-remove", title: 'Delete Snippet' do - Delete + = link_to project_snippet_path(@project, @snippet), method: :delete, data: { confirm: _("Are you sure?") }, class: "btn btn-grouped btn-inverted btn-remove", title: _('Delete Snippet') do + = _('Delete') - if can?(current_user, :create_project_snippet, @project) - = link_to new_project_snippet_path(@project), class: 'btn btn-grouped btn-inverted btn-create', title: "New snippet" do - New snippet + = link_to new_project_snippet_path(@project), class: 'btn btn-grouped btn-inverted btn-create', title: _("New snippet") do + = _('New snippet') - if @snippet.submittable_as_spam_by?(current_user) - = link_to 'Submit as spam', mark_as_spam_project_snippet_path(@project, @snippet), method: :post, class: 'btn btn-grouped btn-spam', title: 'Submit as spam' + = link_to _('Submit as spam'), mark_as_spam_project_snippet_path(@project, @snippet), method: :post, class: 'btn btn-grouped btn-spam', title: _('Submit as spam') - if can?(current_user, :create_project_snippet, @project) || can?(current_user, :update_project_snippet, @snippet) .d-block.d-sm-none.dropdown %button.btn.btn-default.btn-block.append-bottom-0.prepend-top-5{ data: { toggle: "dropdown" } } - Options + = _('Options') = icon('caret-down') .dropdown-menu.dropdown-menu-full-width %ul - if can?(current_user, :create_project_snippet, @project) %li - = link_to new_project_snippet_path(@project), title: "New snippet" do - New snippet + = link_to new_project_snippet_path(@project), title: _("New snippet") do + = _('New snippet') - if can?(current_user, :update_project_snippet, @snippet) %li - = link_to project_snippet_path(@project, @snippet), method: :delete, data: { confirm: "Are you sure?" }, title: 'Delete Snippet' do - Delete + = link_to project_snippet_path(@project, @snippet), method: :delete, data: { confirm: _("Are you sure?") }, title: _('Delete Snippet') do + = _('Delete') - if can?(current_user, :update_project_snippet, @snippet) %li = link_to edit_project_snippet_path(@project, @snippet) do - Edit + = _('Edit') - if @snippet.submittable_as_spam_by?(current_user) %li - = link_to 'Submit as spam', mark_as_spam_project_snippet_path(@project, @snippet), method: :post + = link_to _('Submit as spam'), mark_as_spam_project_snippet_path(@project, @snippet), method: :post diff --git a/app/views/projects/snippets/edit.html.haml b/app/views/projects/snippets/edit.html.haml index 32844f5204a..6dbd67df886 100644 --- a/app/views/projects/snippets/edit.html.haml +++ b/app/views/projects/snippets/edit.html.haml @@ -1,8 +1,8 @@ -- add_to_breadcrumbs "Snippets", project_snippets_path(@project) +- add_to_breadcrumbs _("Snippets"), project_snippets_path(@project) - breadcrumb_title @snippet.to_reference -- page_title "Edit", "#{@snippet.title} (#{@snippet.to_reference})", "Snippets" +- page_title _("Edit"), "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") %h3.page-title - Edit Snippet + = _("Edit Snippet") %hr = render "shared/snippets/form", url: project_snippet_path(@project, @snippet) diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml index 65efc083fdd..1c4c73dc776 100644 --- a/app/views/projects/snippets/index.html.haml +++ b/app/views/projects/snippets/index.html.haml @@ -1,4 +1,4 @@ -- page_title "Snippets" +- page_title _("Snippets") - if current_user .top-area @@ -7,6 +7,6 @@ .nav-controls - if can?(current_user, :create_project_snippet, @project) - = link_to "New snippet", new_project_snippet_path(@project), class: "btn btn-new", title: "New snippet" + = link_to _("New snippet"), new_project_snippet_path(@project), class: "btn btn-new", title: _("New snippet") = render 'snippets/snippets' diff --git a/app/views/projects/snippets/new.html.haml b/app/views/projects/snippets/new.html.haml index 1359a815429..26b333d4ecf 100644 --- a/app/views/projects/snippets/new.html.haml +++ b/app/views/projects/snippets/new.html.haml @@ -1,8 +1,8 @@ -- add_to_breadcrumbs "Snippets", project_snippets_path(@project) -- breadcrumb_title "New" -- page_title "New Snippets" +- add_to_breadcrumbs _("Snippets"), project_snippets_path(@project) +- breadcrumb_title _("New") +- page_title _("New Snippets") %h3.page-title - New Snippet + = _('New Snippet') %hr = render "shared/snippets/form", url: project_snippets_path(@project, @snippet) diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml index 7062c5b765e..f495b4eaf30 100644 --- a/app/views/projects/snippets/show.html.haml +++ b/app/views/projects/snippets/show.html.haml @@ -1,7 +1,7 @@ - @content_class = "limit-container-width limited-inner-width-container" unless fluid_layout -- add_to_breadcrumbs "Snippets", project_snippets_path(@project) +- add_to_breadcrumbs _("Snippets"), project_snippets_path(@project) - breadcrumb_title @snippet.to_reference -- page_title "#{@snippet.title} (#{@snippet.to_reference})", "Snippets" +- page_title "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") = render 'shared/snippets/header' diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 5c4e10bfd4a..0385761de45 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gitlab 1.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-07-01 16:35+1000\n" -"PO-Revision-Date: 2018-07-01 16:35+1000\n" +"POT-Creation-Date: 2018-07-01 21:24+1000\n" +"PO-Revision-Date: 2018-07-01 21:24+1000\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -1815,6 +1815,9 @@ msgstr "" msgid "Delete" msgstr "" +msgid "Delete Snippet" +msgstr "" + msgid "Delete list" msgstr "" @@ -2036,6 +2039,9 @@ msgstr "" msgid "Edit Pipeline Schedule %{id}" msgstr "" +msgid "Edit Snippet" +msgstr "" + msgid "Edit files in the editor and commit changes here" msgstr "" @@ -2978,6 +2984,9 @@ msgstr "" msgid "Nav|Sign out and sign in with a different account" msgstr "" +msgid "New" +msgstr "" + msgid "New Identity" msgstr "" @@ -2998,6 +3007,12 @@ msgstr "" msgid "New Pipeline Schedule" msgstr "" +msgid "New Snippet" +msgstr "" + +msgid "New Snippets" +msgstr "" + msgid "New branch" msgstr "" @@ -4301,6 +4316,9 @@ msgstr "" msgid "Subgroups" msgstr "" +msgid "Submit as spam" +msgstr "" + msgid "Subscribe" msgstr ""