diff options
author | Tao Wang <twang2218@gmail.com> | 2018-06-14 12:19:12 +0300 |
---|---|---|
committer | Tao Wang <twang2218@gmail.com> | 2018-07-01 14:26:11 +0300 |
commit | 9dfae2248de17d8e72cb305d7978865cd6a37098 (patch) | |
tree | 284450eca23837467f068501fef475fa376b357a /app/views/projects/snippets | |
parent | 61c17b253e6560bef377f57d39e7fb99c4659b84 (diff) |
i18n: externalize strings from 'app/views/projects/snippets'
Signed-off-by: Tao Wang <twang2218@gmail.com>
Diffstat (limited to 'app/views/projects/snippets')
-rw-r--r-- | app/views/projects/snippets/_actions.html.haml | 26 | ||||
-rw-r--r-- | app/views/projects/snippets/edit.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/snippets/index.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/snippets/new.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/snippets/show.html.haml | 4 |
5 files changed, 24 insertions, 24 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' |