summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lbennett@gitlab.com>2019-01-28 04:06:55 +0000
committerLuke Bennett <lbennett@gitlab.com>2019-01-28 04:56:04 +0000
commit844c3ac5505cac47efada0f13ee8e68185f4f637 (patch)
treec9ed1404942084cc91ac8da89906a09bc828cf89
parentc243b154abf5c29ba35fd2fab2ca3bc010fdc324 (diff)
downloadgitlab-ce-hooks-ext.tar.gz
Externalize admin hooks stringshooks-ext
-rw-r--r--app/views/admin/hooks/index.html.haml16
-rw-r--r--app/views/shared/plugins/_index.html.haml10
-rw-r--r--app/views/shared/web_hooks/_test_button.html.haml2
-rw-r--r--changelogs/unreleased/hooks-ext.yml5
-rw-r--r--locale/gitlab.pot27
5 files changed, 46 insertions, 14 deletions
diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml
index b65bf07160a..ee6ea8d816c 100644
--- a/app/views/admin/hooks/index.html.haml
+++ b/app/views/admin/hooks/index.html.haml
@@ -1,35 +1,35 @@
-- page_title 'System Hooks'
+- page_title _('System Hooks')
.row.prepend-top-default
.col-lg-4
%h4.prepend-top-0
= page_title
%p
- #{link_to 'System hooks ', help_page_path('system_hooks/system_hooks')} can be
- used for binding events when GitLab creates a User or Project.
+ - hooks_link_start = "<a href='#{help_page_path('system_hooks/system_hooks')}' target='_blank' rel='noreferrer noopener'>".html_safe
+ = _('%{hooks_link_start}System hooks%{link_end} can be used for binding events when GitLab creates a User or Project.').html_safe % { hooks_link_start: hooks_link_start, link_end: '</a>'.html_safe }
.col-lg-8.append-bottom-default
= form_for @hook, as: :hook, url: admin_hooks_path do |f|
= render partial: 'form', locals: { form: f, hook: @hook }
- = f.submit 'Add system hook', class: 'btn btn-success'
+ = f.submit _('Add system hook'), class: 'btn btn-success'
%hr
- if @hooks.any?
.card
.card-header
- System hooks (#{@hooks.count})
+ = _('System hooks (%{hooks_count})') % { hooks_count: @hooks.count }
%ul.content-list
- @hooks.each do |hook|
%li
.controls
= render 'shared/web_hooks/test_button', triggers: SystemHook.triggers, hook: hook, button_class: 'btn-sm'
- = link_to 'Edit', edit_admin_hook_path(hook), class: 'btn btn-sm'
- = link_to 'Remove', admin_hook_path(hook), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm'
+ = link_to _('Edit'), edit_admin_hook_path(hook), class: 'btn btn-sm'
+ = link_to _('Remove'), admin_hook_path(hook), data: { confirm: _('Are you sure?') }, method: :delete, class: 'btn btn-remove btn-sm'
.monospace= hook.url
%div
- SystemHook.triggers.each_value do |event|
- if hook.public_send(event)
%span.badge.badge-gray= event.to_s.titleize
- %span.badge.badge-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'}
+ %span.badge.badge-gray= _("SSL Verification: %{ssl_status}") % { ssl_status: hook.enable_ssl_verification ? 'enabled' : 'disabled' }
= render 'shared/plugins/index'
diff --git a/app/views/shared/plugins/_index.html.haml b/app/views/shared/plugins/_index.html.haml
index 9d230d12be2..c9884d7bb9b 100644
--- a/app/views/shared/plugins/_index.html.haml
+++ b/app/views/shared/plugins/_index.html.haml
@@ -3,16 +3,16 @@
.row.prepend-top-default
.col-lg-4
%h4.prepend-top-0
- Plugins
+ = _('Plugins')
%p
- #{link_to 'Plugins', help_page_path('administration/plugins')} are similar to
- system hooks but are executed as files instead of sending data to a URL.
+ - plugins_link_start = "<a href='#{help_page_path('administration/plugins')}' target='_blank' rel='noopener noreferrer'>".html_safe
+ = _("%{plugins_link_start}Plugins%{link_end} are similar to system hooks but are executed as files instead of sending data to a URL.").html_safe % { plugins_link_start: plugins_link_start, link_end: '</a>'.html_safe }
.col-lg-8.append-bottom-default
- if plugins.any?
.card
.card-header
- Plugins (#{plugins.count})
+ = _('Plugins (%{plugins_count})') % { plugins_count: plugins.count }
%ul.content-list
- plugins.each do |file|
%li
@@ -20,4 +20,4 @@
= File.basename(file)
- else
.card.bg-light.text-center
- .nothing-here-block No plugins found.
+ .nothing-here-block= _('No plugins found.')
diff --git a/app/views/shared/web_hooks/_test_button.html.haml b/app/views/shared/web_hooks/_test_button.html.haml
index 5ece8b1d4c7..b5e31733aa9 100644
--- a/app/views/shared/web_hooks/_test_button.html.haml
+++ b/app/views/shared/web_hooks/_test_button.html.haml
@@ -4,7 +4,7 @@
.hook-test-button.dropdown.inline
%button.btn{ 'data-toggle' => 'dropdown', class: button_class }
- Test
+ = _('Test')
= icon('caret-down')
%ul.dropdown-menu.dropdown-menu-right{ role: 'menu' }
- triggers.each_value do |event|
diff --git a/changelogs/unreleased/hooks-ext.yml b/changelogs/unreleased/hooks-ext.yml
new file mode 100644
index 00000000000..897172f7af9
--- /dev/null
+++ b/changelogs/unreleased/hooks-ext.yml
@@ -0,0 +1,5 @@
+---
+title: Externalize admin hooks strings
+merge_request:
+author:
+type: other
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index a72e921dcce..b7dd9ca07fd 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -126,6 +126,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 "%{hooks_link_start}System hooks%{link_end} can be used for binding events when GitLab creates a User or Project."
+msgstr ""
+
msgid "%{issuableType} will be removed! Are you sure?"
msgstr ""
@@ -150,6 +153,9 @@ msgstr ""
msgid "%{percent}%% complete"
msgstr ""
+msgid "%{plugins_link_start}Plugins%{link_end} are similar to system hooks but are executed as files instead of sending data to a URL."
+msgstr ""
+
msgid "%{strong_start}%{branch_count}%{strong_end} Branch"
msgid_plural "%{strong_start}%{branch_count}%{strong_end} Branches"
msgstr[0] ""
@@ -402,6 +408,9 @@ msgstr ""
msgid "Add reaction"
msgstr ""
+msgid "Add system hook"
+msgstr ""
+
msgid "Add to project"
msgstr ""
@@ -4638,6 +4647,9 @@ msgstr ""
msgid "No other labels with such name or description"
msgstr ""
+msgid "No plugins found."
+msgstr ""
+
msgid "No preview for this file type"
msgstr ""
@@ -5168,6 +5180,12 @@ msgstr ""
msgid "Please wait while we import the repository for you. Refresh at will."
msgstr ""
+msgid "Plugins"
+msgstr ""
+
+msgid "Plugins (%{plugins_count})"
+msgstr ""
+
msgid "Preferences"
msgstr ""
@@ -6024,6 +6042,9 @@ msgstr ""
msgid "SSL Verification"
msgstr ""
+msgid "SSL Verification: %{ssl_status}"
+msgstr ""
+
msgid "Save"
msgstr ""
@@ -6725,6 +6746,9 @@ msgstr ""
msgid "System Info"
msgstr ""
+msgid "System hooks (%{hooks_count})"
+msgstr ""
+
msgid "System metrics (Custom)"
msgstr ""
@@ -6836,6 +6860,9 @@ msgstr ""
msgid "Terms of Service and Privacy Policy"
msgstr ""
+msgid "Test"
+msgstr ""
+
msgid "Test coverage parsing"
msgstr ""