Commit 39b4dab0 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'jramsay-4012-externalize-wiki-strings' into 'master'

Add translatable strings to wiki pages

See merge request gitlab-org/gitlab-ce!14534
parents 05e9c9f7 cd6f683e
- commit_message = @page.persisted? ? "Update #{@page.title}" : "Create #{@page.title}" - commit_message = @page.persisted? ? s_("WikiPageEdit|Update %{page_title}") : s_("WikiPageCreate|Create %{page_title}")
- commit_message = commit_message % { page_title: @page.title }
= form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal wiki-form common-note-form prepend-top-default js-quick-submit' } do |f| = form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: 'form-horizontal wiki-form common-note-form prepend-top-default js-quick-submit' } do |f|
= form_errors(@page) = form_errors(@page)
...@@ -12,13 +13,13 @@ ...@@ -12,13 +13,13 @@
.form-group .form-group
.col-sm-12= f.label :format, class: 'control-label-full-width' .col-sm-12= f.label :format, class: 'control-label-full-width'
.col-sm-12 .col-sm-12
= f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: "form-control" = f.select :format, options_for_select(ProjectWiki::MARKUPS, {selected: @page.format}), {}, class: 'form-control'
.form-group .form-group
.col-sm-12= f.label :content, class: 'control-label-full-width' .col-sm-12= f.label :content, class: 'control-label-full-width'
.col-sm-12 .col-sm-12
= render layout: 'projects/md_preview', locals: { url: project_wiki_preview_markdown_path(@project, @page.slug) } do = render layout: 'projects/md_preview', locals: { url: project_wiki_preview_markdown_path(@project, @page.slug) } do
= render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: 'Write your content or drag files here...' = render 'projects/zen', f: f, attr: :content, classes: 'note-textarea', placeholder: s_("WikiPage|Write your content or drag files here...")
= render 'shared/notes/hints' = render 'shared/notes/hints'
.clearfix .clearfix
...@@ -26,12 +27,11 @@ ...@@ -26,12 +27,11 @@
.help-block .help-block
= succeed '.' do = succeed '.' do
To link to a (new) page, simply type = (s_("WikiMarkdownTip|To link to a (new) page, simply type %{link_example}") % { link_example: '<code>[Link Title](page-slug)</code>' }).html_safe
%code [Link Title](page-slug)
= succeed '.' do = succeed '.' do
More examples are in the - markdown_link = link_to s_("WikiMarkdownDocs|documentation"), help_page_path('user/markdown', anchor: 'wiki-specific-markdown')
= link_to 'documentation', help_page_path("user/markdown", anchor: "wiki-specific-markdown") = (s_("WikiMarkdownDocs|More examples are in the %{docs_link}") % { docs_link: markdown_link }).html_safe
.form-group .form-group
.col-sm-12= f.label :commit_message, class: 'control-label-full-width' .col-sm-12= f.label :commit_message, class: 'control-label-full-width'
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
.form-actions .form-actions
- if @page && @page.persisted? - if @page && @page.persisted?
= f.submit 'Save changes', class: "btn-save btn" = f.submit _("Save changes"), class: 'btn-save btn'
.pull-right .pull-right
= link_to "Cancel", project_wiki_path(@project, @page), class: "btn btn-cancel btn-grouped" = link_to _("Cancel"), project_wiki_path(@project, @page), class: 'btn btn-cancel btn-grouped'
- else - else
= f.submit 'Create page', class: "btn-create btn" = f.submit s_("Wiki|Create page"), class: 'btn-create btn'
.pull-right .pull-right
= link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel" = link_to _("Cancel"), project_wiki_path(@project, :home), class: 'btn btn-cancel'
- if (@page && @page.persisted?) - if (@page && @page.persisted?)
- if can?(current_user, :create_wiki, @project) - if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
New page = s_("Wiki|New page")
= link_to project_wiki_history_path(@project, @page), class: "btn" do = link_to project_wiki_history_path(@project, @page), class: "btn" do
Page history = s_("Wiki|Page history")
- if can?(current_user, :create_wiki, @project) && @page.latest? - if can?(current_user, :create_wiki, @project) && @page.latest?
= link_to project_wiki_edit_path(@project, @page), class: "btn js-wiki-edit" do = link_to project_wiki_edit_path(@project, @page), class: "btn js-wiki-edit" do
Edit = _("Edit")
...@@ -3,16 +3,15 @@ ...@@ -3,16 +3,15 @@
.modal-content .modal-content
.modal-header .modal-header
%a.close{ href: "#", "data-dismiss" => "modal" } × %a.close{ href: "#", "data-dismiss" => "modal" } ×
%h3.page-title New Wiki Page %h3.page-title= s_("WikiNewPageTitle|New Wiki Page")
.modal-body .modal-body
%form.new-wiki-page %form.new-wiki-page
.form-group .form-group
= label_tag :new_wiki_path do = label_tag :new_wiki_path do
%span Page slug %span= s_("WikiPage|Page slug")
= text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'form-control', required: true, :'data-wikis-path' => project_wikis_path(@project), autofocus: true = text_field_tag :new_wiki_path, nil, placeholder: s_("WikiNewPagePlaceholder|how-to-setup"), class: 'form-control', required: true, :'data-wikis-path' => project_wikis_path(@project), autofocus: true
%span.new-wiki-page-slug-tip %span.new-wiki-page-slug-tip
= icon('lightbulb-o') = icon('lightbulb-o')
Tip: You can specify the full path for the new file. = s_("WikiNewPageTip|Tip: You can specify the full path for the new file. We will automatically create any missing directories.")
We will automatically create any missing directories.
.form-actions .form-actions
= button_tag 'Create page', class: 'build-new-wiki btn btn-create' = button_tag s_("Wiki|Create page"), class: "build-new-wiki btn btn-create"
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
= link_to wiki_page.title, project_wiki_path(@project, wiki_page) = link_to wiki_page.title, project_wiki_path(@project, wiki_page)
%small (#{wiki_page.format}) %small (#{wiki_page.format})
.pull-right .pull-right
%small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)} %small= (s_("Last edited %{date}") % { date: time_ago_with_tooltip(wiki_page.commit.authored_date) }).html_safe
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '' do = link_to git_access_url, class: active_nav_link?(path: 'wikis#git_access') ? 'active' : '' do
= succeed '&nbsp;' do = succeed '&nbsp;' do
= icon('cloud-download') = icon('cloud-download')
Clone repository = _("Clone repository")
.blocks-container .blocks-container
.block.block-first .block.block-first
...@@ -17,6 +17,6 @@ ...@@ -17,6 +17,6 @@
.block .block
= link_to project_wikis_pages_path(@project), class: 'btn btn-block' do = link_to project_wikis_pages_path(@project), class: 'btn btn-block' do
More Pages = s_("Wiki|More Pages")
= render 'projects/wikis/new' = render 'projects/wikis/new'
- @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout - @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout
- page_title "Edit", @page.title.capitalize, "Wiki" - page_title _("Edit"), @page.title.capitalize, _("Wiki")
- if @conflict - if @conflict
.alert.alert-danger .alert.alert-danger
Someone edited the page the same time you did. Please check out - page_link = link_to s_("WikiPageConflictMessage|the page"), project_wiki_path(@project, @page), target: "_blank"
= link_to "the page", project_wiki_path(@project, @page), target: "_blank" = (s_("WikiPageConflictMessage|Someone edited the page the same time you did. Please check out %{page_link} and make sure your changes will not unintentionally remove theirs.") % { page_link: page_link }).html_safe
and make sure your changes will not unintentionally remove theirs.
.wiki-page-header.has-sidebar-toggle .wiki-page-header.has-sidebar-toggle
%button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
...@@ -20,20 +19,20 @@ ...@@ -20,20 +19,20 @@
%span.light %span.light
&middot; &middot;
- if @page.persisted? - if @page.persisted?
Edit Page = s_("Wiki|Edit Page")
- else - else
Create Page = s_("Wiki|Create Page")
.nav-controls .nav-controls
- if can?(current_user, :create_wiki, @project) - if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
New page = s_("Wiki|New page")
- if @page.persisted? - if @page.persisted?
= link_to project_wiki_history_path(@project, @page), class: "btn" do = link_to project_wiki_history_path(@project, @page), class: "btn" do
Page history = s_("Wiki|Page history")
- if can?(current_user, :admin_wiki, @project) - if can?(current_user, :admin_wiki, @project)
= link_to project_wiki_path(@project, @page), data: { confirm: "Are you sure you want to delete this page?"}, method: :delete, class: "btn btn-danger" do = link_to project_wiki_path(@project, @page), data: { confirm: s_("WikiPageConfirmDelete|Are you sure you want to delete this page?")}, method: :delete, class: "btn btn-danger" do
Delete = _("Delete")
= render 'form' = render 'form'
......
- page_title "Wiki" - page_title _("Wiki")
%h3.page-title Empty page %h3.page-title= _("Wiki|Empty page")
%hr %hr
.error_message .error_message
You are not allowed to create wiki pages = s_("WikiEmptyPageError|You are not allowed to create wiki pages")
- @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout - @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout
- page_title "Git Access", "Wiki" - page_title s_("WikiClone|Git Access"), _("Wiki")
.wiki-page-header.has-sidebar-toggle .wiki-page-header.has-sidebar-toggle
%button.btn.btn-default.visible-xs.visible-sm.pull-right.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } %button.btn.btn-default.visible-xs.visible-sm.pull-right.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
= icon('angle-double-left') = icon('angle-double-left')
.git-access-header .git-access-header
Clone repository = _("Clone repository")
%strong= @project_wiki.full_path %strong= @project_wiki.full_path
= render "shared/clone_panel", project: @project_wiki = render "shared/clone_panel", project: @project_wiki
.wiki-git-access .wiki-git-access
%h3 Install Gollum %h3= s_("WikiClone|Install Gollum")
%pre.dark %pre.dark
:preserve :preserve
gem install gollum gem install gollum
%p %p
It is recommended to install = (s_("WikiClone|It is recommended to install %{markdown} so that GFM features render locally:") % { markdown: "<code>github-markdown</code>" }).html_safe
%code github-markdown
so that GFM features render locally:
%pre.dark %pre.dark
:preserve :preserve
gem install github-markdown gem install github-markdown
%h3 Clone your wiki %h3= s_("WikiClone|Clone your wiki")
%pre.dark %pre.dark
:preserve :preserve
git clone #{ content_tag(:span, h(default_url_to_repo(@project_wiki)), class: 'clone')} git clone #{ content_tag(:span, h(default_url_to_repo(@project_wiki)), class: 'clone')}
cd #{h @project_wiki.path} cd #{h @project_wiki.path}
%h3 Start Gollum and edit locally %h3= s_("WikiClone|Start Gollum and edit locally")
%pre.dark %pre.dark
:preserve :preserve
gollum gollum
......
- page_title "History", @page.title.capitalize, "Wiki" - page_title _("History"), @page.title.capitalize, _("Wiki")
.wiki-page-header.has-sidebar-toggle .wiki-page-header.has-sidebar-toggle
%button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
= link_to @page.title.capitalize, project_wiki_path(@project, @page) = link_to @page.title.capitalize, project_wiki_path(@project, @page)
%span.light %span.light
&middot; &middot;
History = _("History")
.table-holder .table-holder
%table.table %table.table
%thead %thead
%tr %tr
%th Page version %th= s_("Wiki|Page version")
%th Author %th= _("Author")
%th Commit Message %th= _("Commit Message")
%th Last updated %th= _("Last updated")
%th Format %th= _("Format")
%tbody %tbody
- @page.versions.each_with_index do |version, index| - @page.versions.each_with_index do |version, index|
- commit = version - commit = version
......
- @no_container = true - @no_container = true
- add_to_breadcrumbs "Wiki", get_project_wiki_path(@project) - add_to_breadcrumbs "Wiki", get_project_wiki_path(@project)
- breadcrumb_title "Pages" - breadcrumb_title s_("Wiki|Pages")
- page_title "Pages", "Wiki" - page_title s_("Wiki|Pages"), _("Wiki")
%div{ class: container_class } %div{ class: container_class }
.wiki-page-header .wiki-page-header
.nav-text .nav-text
%h2.wiki-page-title %h2.wiki-page-title
Wiki Pages = s_("Wiki|Wiki Pages")
.nav-controls .nav-controls
= link_to project_wikis_git_access_path(@project), class: 'btn' do = link_to project_wikis_git_access_path(@project), class: 'btn' do
= icon('cloud-download') = icon('cloud-download')
Clone repository = _("Clone repository")
%ul.wiki-pages-list.content-list %ul.wiki-pages-list.content-list
= render @wiki_entries, context: 'pages' = render @wiki_entries, context: 'pages'
......
- @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout - @content_class = "limit-container-width limit-container-width-sm" unless fluid_layout
- breadcrumb_title @page.title.capitalize - breadcrumb_title @page.title.capitalize
- wiki_breadcrumb_dropdown_links(@page.slug) - wiki_breadcrumb_dropdown_links(@page.slug)
- page_title @page.title.capitalize, "Wiki" - page_title @page.title.capitalize, _("Wiki")
- add_to_breadcrumbs "Wiki", get_project_wiki_path(@project) - add_to_breadcrumbs _("Wiki"), get_project_wiki_path(@project)
.wiki-page-header.has-sidebar-toggle .wiki-page-header.has-sidebar-toggle
%button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" } %button.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle{ role: "button", type: "button" }
...@@ -11,9 +11,7 @@ ...@@ -11,9 +11,7 @@
.nav-text .nav-text
%h2.wiki-page-title= @page.title.capitalize %h2.wiki-page-title= @page.title.capitalize
%span.wiki-last-edit-by %span.wiki-last-edit-by
Last edited by = (_("Last edited by %{name}") % { name: "<strong>#{@page.commit.author.name}</strong>" }).html_safe
%strong
#{@page.commit.author.name}
#{time_ago_with_tooltip(@page.commit.authored_date)} #{time_ago_with_tooltip(@page.commit.authored_date)}
.nav-controls .nav-controls
...@@ -21,8 +19,10 @@ ...@@ -21,8 +19,10 @@
- if @page.historical? - if @page.historical?
.warning_message .warning_message
This is an old version of this page. = s_("WikiHistoricalPage|This is an old version of this page.")
You can view the #{link_to "most recent version", project_wiki_path(@project, @page)} or browse the #{link_to "history", project_wiki_history_path(@project, @page)}. - most_recent_link = link_to s_("WikiHistoricalPage|most recent version"), project_wiki_path(@project, @page)
- history_link = link_to s_("WikiHistoricalPage|history"), project_wiki_history_path(@project, @page)
= (s_("WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}.") % { most_recent_link: most_recent_link, history_link: history_link }).html_safe
.wiki-holder.prepend-top-default.append-bottom-default .wiki-holder.prepend-top-default.append-bottom-default
.wiki .wiki
......
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-27 15:43+0100\n" "POT-Creation-Date: 2017-09-28 13:28-0400\n"
"PO-Revision-Date: 2017-09-27 15:43+0100\n" "PO-Revision-Date: 2017-09-28 13:28-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -134,6 +134,9 @@ msgstr "" ...@@ -134,6 +134,9 @@ msgstr ""
msgid "Authentication Log" msgid "Authentication Log"
msgstr "" msgstr ""
msgid "Author"
msgstr ""
msgid "Auto Review Apps and Auto Deploy need a domain name and the %{kubernetes} to work correctly." msgid "Auto Review Apps and Auto Deploy need a domain name and the %{kubernetes} to work correctly."
msgstr "" msgstr ""
...@@ -361,6 +364,9 @@ msgstr "" ...@@ -361,6 +364,9 @@ msgstr ""
msgid "CiStatus|running" msgid "CiStatus|running"
msgstr "" msgstr ""
msgid "Clone repository"
msgstr ""
msgid "Comments" msgid "Comments"
msgstr "" msgstr ""
...@@ -369,6 +375,9 @@ msgid_plural "Commits" ...@@ -369,6 +375,9 @@ msgid_plural "Commits"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Commit Message"
msgstr ""
msgid "Commit duration in minutes for last 30 commits" msgid "Commit duration in minutes for last 30 commits"
msgstr "" msgstr ""
...@@ -610,6 +619,9 @@ msgstr[1] "" ...@@ -610,6 +619,9 @@ msgstr[1] ""
msgid "ForkedFromProjectPath|Forked from" msgid "ForkedFromProjectPath|Forked from"
msgstr "" msgstr ""
msgid "Format"
msgstr ""
msgid "From issue creation until deploy to production" msgid "From issue creation until deploy to production"
msgstr "" msgstr ""
...@@ -673,6 +685,9 @@ msgstr "" ...@@ -673,6 +685,9 @@ msgstr ""
msgid "HealthCheck|Unhealthy" msgid "HealthCheck|Unhealthy"
msgstr "" msgstr ""
msgid "History"
msgstr ""
msgid "Housekeeping successfully started" msgid "Housekeeping successfully started"
msgstr "" msgstr ""
...@@ -720,6 +735,15 @@ msgstr "" ...@@ -720,6 +735,15 @@ msgstr ""
msgid "Last commit" msgid "Last commit"
msgstr "" msgstr ""
msgid "Last edited %{date}"
msgstr ""
msgid "Last edited by %{name}"
msgstr ""
msgid "Last updated"
msgstr ""
msgid "LastPushEvent|You pushed to" msgid "LastPushEvent|You pushed to"
msgstr "" msgstr ""
...@@ -1141,6 +1165,9 @@ msgstr "" ...@@ -1141,6 +1165,9 @@ msgstr ""
msgid "SSH Keys" msgid "SSH Keys"
msgstr "" msgstr ""
msgid "Save changes"
msgstr ""
msgid "Save pipeline schedule" msgid "Save pipeline schedule"
msgstr "" msgstr ""
...@@ -1590,6 +1617,105 @@ msgstr "" ...@@ -1590,6 +1617,105 @@ msgstr ""
msgid "Wiki" msgid "Wiki"
msgstr "" msgstr ""
msgid "WikiClone|Clone your wiki"
msgstr ""
msgid "WikiClone|Git Access"
msgstr ""
msgid "WikiClone|Install Gollum"
msgstr ""
msgid "WikiClone|It is recommended to install %{markdown} so that GFM features render locally:"
msgstr ""
msgid "WikiClone|Start Gollum and edit locally"
msgstr ""
msgid "WikiEmptyPageError|You are not allowed to create wiki pages"
msgstr ""
msgid "WikiHistoricalPage|This is an old version of this page."
msgstr ""
msgid "WikiHistoricalPage|You can view the %{most_recent_link} or browse the %{history_link}."
msgstr ""
msgid "WikiHistoricalPage|history"
msgstr ""
msgid "WikiHistoricalPage|most recent version"
msgstr ""
msgid "WikiMarkdownDocs|More examples are in the %{docs_link}"
msgstr ""
msgid "WikiMarkdownDocs|documentation"
msgstr ""
msgid "WikiMarkdownTip|To link to a (new) page, simply type %{link_example}"
msgstr ""
msgid "WikiNewPagePlaceholder|how-to-setup"
msgstr ""
msgid "WikiNewPageTip|Tip: You can specify the full path for the new file. We will automatically create any missing directories."
msgstr ""
msgid "WikiNewPageTitle|New Wiki Page"
msgstr ""
msgid "WikiPageConfirmDelete|Are you sure you want to delete this page?"
msgstr ""
msgid "WikiPageConflictMessage|Someone edited the page the same time you did. Please check out %{page_link} and make sure your changes will not unintentionally remove theirs."
msgstr ""
msgid "WikiPageConflictMessage|the page"
msgstr ""
msgid "WikiPageCreate|Create %{page_title}"
msgstr ""
msgid "WikiPageEdit|Update %{page_title}"
msgstr ""
msgid "WikiPage|Page slug"
msgstr ""
msgid "WikiPage|Write your content or drag files here..."
msgstr ""
msgid "Wiki|Create Page"
msgstr ""
msgid "Wiki|Create page"
msgstr ""
msgid "Wiki|Edit Page"
msgstr ""
msgid "Wiki|Empty page"
msgstr ""
msgid "Wiki|More Pages"
msgstr ""
msgid "Wiki|New page"
msgstr ""
msgid "Wiki|Page history"
msgstr ""
msgid "Wiki|Page version"
msgstr ""
msgid "Wiki|Pages"
msgstr ""
msgid "Wiki|Wiki Pages"
msgstr ""
msgid "Withdraw Access Request" msgid "Withdraw Access Request"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment