Externalize strings of PGP Keys and SSH Keys page in user profile

This commit is contained in:
antony liu 2019-05-30 17:56:56 +00:00 committed by Clement Ho
parent c7e5d046a5
commit 8d746d1475
12 changed files with 100 additions and 36 deletions

View File

@ -3,8 +3,8 @@
= form_errors(@gpg_key)
.form-group
= f.label :key, class: 'label-bold'
= f.text_area :key, class: "form-control", rows: 8, required: true, placeholder: "Don't paste the private part of the GPG key. Paste the public part which begins with '-----BEGIN PGP PUBLIC KEY BLOCK-----'."
= f.label :key, s_('Profiles|Key'), class: 'label-bold'
= f.text_area :key, class: "form-control", rows: 8, required: true, placeholder: _("Don't paste the private part of the GPG key. Paste the public part which begins with '-----BEGIN PGP PUBLIC KEY BLOCK-----'.")
.prepend-top-default
= f.submit 'Add key', class: "btn btn-success"
= f.submit s_('Profiles|Add key'), class: "btn btn-success"

View File

@ -9,17 +9,19 @@
%code= key.fingerprint
- if key.subkeys.present?
.subkeys
%span.bold Subkeys:
%span.bold
= _('Subkeys')
= ':'
%ul.subkeys-list
- key.subkeys.each do |subkey|
%li
%code= subkey.fingerprint
.float-right
%span.key-created-at
created #{time_ago_with_tooltip(key.created_at)}
= link_to profile_gpg_key_path(key), data: { confirm: 'Are you sure? Removing this GPG key does not affect already signed commits.' }, method: :delete, class: "btn btn-danger prepend-left-10" do
%span.sr-only Remove
= s_('Profiles|Created %{time_ago}'.html_safe) % { time_ago:time_ago_with_tooltip(key.created_at)}
= link_to profile_gpg_key_path(key), data: { confirm: _('Are you sure? Removing this GPG key does not affect already signed commits.') }, method: :delete, class: "btn btn-danger prepend-left-10" do
%span.sr-only= _('Remove')
= icon('trash')
= link_to revoke_profile_gpg_key_path(key), data: { confirm: 'Are you sure? All commits that were signed with this GPG key will be unverified.' }, method: :put, class: "btn btn-danger prepend-left-10" do
%span.sr-only Revoke
Revoke
= link_to revoke_profile_gpg_key_path(key), data: { confirm: _('Are you sure? All commits that were signed with this GPG key will be unverified.') }, method: :put, class: "btn btn-danger prepend-left-10" do
%span.sr-only= _('Revoke')
= _('Revoke')

View File

@ -6,6 +6,6 @@
- else
%p.settings-message.text-center
- if is_admin
There are no GPG keys associated with this account.
= _('There are no GPG keys associated with this account.')
- else
There are no GPG keys with access to your account.
= _('There are no GPG keys with access to your account.')

View File

@ -1,4 +1,4 @@
- page_title "GPG Keys"
- page_title _('GPG Keys')
- @content_class = "limit-container-width" unless fluid_layout
.row.prepend-top-default
@ -6,16 +6,16 @@
%h4.prepend-top-0
= page_title
%p
GPG keys allow you to verify signed commits.
= _('GPG keys allow you to verify signed commits.')
.col-lg-8
%h5.prepend-top-0
Add a GPG key
= _('Add a GPG key')
%p.profile-settings-content
Before you can add a GPG key you need to
= link_to 'generate it.', help_page_path('user/project/repository/gpg_signed_commits/index.md')
- help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/repository/gpg_signed_commits/index.md') }
= _('Before you can add a GPG key you need to %{help_link_start}Generate it.%{help_link_end}'.html_safe) % {help_link_start: help_link_start, help_link_end:'</a>'.html_safe }
= render 'form'
%hr
%h5
Your GPG keys (#{@gpg_keys.count})
= _('Your GPG keys (%{count})') % { count:@gpg_keys.count}
.append-bottom-default
= render 'key_table'

View File

@ -3,11 +3,11 @@
= form_errors(@key)
.form-group
= f.label :key, class: 'label-bold'
= f.label :key, s_('Profiles|Key'), class: 'label-bold'
%p= _("Paste your public SSH key, which is usually contained in the file '~/.ssh/id_rsa.pub' and begins with 'ssh-rsa'. Don't use your private SSH key.")
= f.text_area :key, class: "form-control js-add-ssh-key-validation-input qa-key-public-key-field", rows: 8, required: true, placeholder: s_('Profiles|Typically starts with "ssh-rsa …"')
.form-group
= f.label :title, class: 'label-bold'
= f.label :title, _('Title'), class: 'label-bold'
= f.text_field :title, class: "form-control input-lg qa-key-title-field", required: true, placeholder: s_('Profiles|e.g. My MacBook key')
%p.form-text.text-muted= _('Name your individual key via a title')

View File

@ -17,7 +17,7 @@
= key.last_used_at ? time_ago_with_tooltip(key.last_used_at) : 'n/a'
.float-right
%span.key-created-at
created #{time_ago_with_tooltip(key.created_at)}
= link_to path_to_key(key, is_admin), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-transparent prepend-left-10" do
%span.sr-only Remove
= s_('Profiles|Created %{time_ago}'.html_safe) % { time_ago:time_ago_with_tooltip(key.created_at)}
= link_to path_to_key(key, is_admin), data: { confirm: _('Are you sure?')}, method: :delete, class: "btn btn-transparent prepend-left-10" do
%span.sr-only= _('Remove')
= icon('trash')

View File

@ -3,25 +3,25 @@
.col-md-4
.card
.card-header
SSH Key
= _('SSH Key')
%ul.content-list
%li
%span.light Title:
%span.light= _('Title:')
%strong= @key.title
%li
%span.light Created on:
%span.light= _('Created on:')
%strong= @key.created_at.to_s(:medium)
%li
%span.light Last used on:
%span.light= _('Last used on:')
%strong= @key.last_used_at.try(:to_s, :medium) || 'N/A'
.col-md-8
= form_errors(@key, type: 'key') unless @key.valid?
%p
%span.light Fingerprint:
%span.light= _('Fingerprint:')
%code.key-fingerprint= @key.fingerprint
%pre.well-pre
= @key.key
.col-md-12
.float-right
= link_to 'Remove', path_to_key(@key, is_admin), data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove delete-key qa-delete-key-button"
= link_to _('Remove'), path_to_key(@key, is_admin), data: {confirm: _('Are you sure?')}, method: :delete, class: "btn btn-remove delete-key qa-delete-key-button"

View File

@ -6,6 +6,6 @@
- else
%p.settings-message.text-center
- if is_admin
There are no SSH keys associated with this account.
= _('There are no SSH keys associated with this account.')
- else
There are no SSH keys with access to your account.
= _('There are no SSH keys with access to your account.')

View File

@ -1,4 +1,4 @@
- page_title "SSH Keys"
- page_title _('SSH Keys')
- @content_class = "limit-container-width" unless fluid_layout
.row.prepend-top-default
@ -6,10 +6,10 @@
%h4.prepend-top-0
= page_title
%p
SSH keys allow you to establish a secure connection between your computer and GitLab.
= _('SSH keys allow you to establish a secure connection between your computer and GitLab.')
.col-lg-8
%h5.prepend-top-0
Add an SSH key
= _('Add an SSH key')
%p.profile-settings-content
- generate_link_url = help_page_path("ssh/README", anchor: 'generating-a-new-ssh-key-pair')
- existing_link_url = help_page_path("ssh/README", anchor: 'locating-an-existing-ssh-key-pair')
@ -19,6 +19,6 @@
= render 'form'
%hr
%h5
Your SSH keys (#{@keys.count})
= _('Your SSH keys (%{count})') % { count:@keys.count }
.append-bottom-default
= render 'key_table'

View File

@ -1,5 +1,5 @@
- add_to_breadcrumbs "SSH Keys", profile_keys_path
- breadcrumb_title @key.title
- page_title @key.title, "SSH Keys"
- page_title @key.title, _('SSH Keys')
- @content_class = "limit-container-width" unless fluid_layout
= render "key_details"

View File

@ -0,0 +1,5 @@
---
title: Externalize strings of PGP Keys and SSH Keys page in user profile
merge_request: 28653
author: Antony Liu
type: other

View File

@ -517,6 +517,9 @@ msgstr ""
msgid "Add README"
msgstr ""
msgid "Add a GPG key"
msgstr ""
msgid "Add a bullet list"
msgstr ""
@ -541,6 +544,9 @@ msgstr ""
msgid "Add a todo"
msgstr ""
msgid "Add an SSH key"
msgstr ""
msgid "Add bold text"
msgstr ""
@ -1138,6 +1144,12 @@ msgstr ""
msgid "Are you sure?"
msgstr ""
msgid "Are you sure? All commits that were signed with this GPG key will be unverified."
msgstr ""
msgid "Are you sure? Removing this GPG key does not affect already signed commits."
msgstr ""
msgid "Artifacts"
msgstr ""
@ -3559,6 +3571,9 @@ msgstr ""
msgid "Domain verification is an essential security measure for public GitLab sites. Users are required to demonstrate they control a domain before it is enabled"
msgstr ""
msgid "Don't paste the private part of the GPG key. Paste the public part which begins with '-----BEGIN PGP PUBLIC KEY BLOCK-----'."
msgstr ""
msgid "Don't show again"
msgstr ""
@ -4440,6 +4455,9 @@ msgstr ""
msgid "Fingerprint"
msgstr ""
msgid "Fingerprint:"
msgstr ""
msgid "Fingerprints"
msgstr ""
@ -4572,6 +4590,9 @@ msgstr ""
msgid "GPG Keys"
msgstr ""
msgid "GPG keys allow you to verify signed commits."
msgstr ""
msgid "GPG signature (loading...)"
msgstr ""
@ -5668,6 +5689,9 @@ msgstr ""
msgid "Last used"
msgstr ""
msgid "Last used on:"
msgstr ""
msgid "LastPushEvent|You pushed to"
msgstr ""
@ -7384,6 +7408,9 @@ msgstr ""
msgid "Profiles|Invalid username"
msgstr ""
msgid "Profiles|Key"
msgstr ""
msgid "Profiles|Learn more"
msgstr ""
@ -8465,6 +8492,9 @@ msgstr ""
msgid "Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects."
msgstr ""
msgid "SSH Key"
msgstr ""
msgid "SSH Keys"
msgstr ""
@ -8474,6 +8504,9 @@ msgstr ""
msgid "SSH host keys"
msgstr ""
msgid "SSH keys allow you to establish a secure connection between your computer and GitLab."
msgstr ""
msgid "SSH public key"
msgstr ""
@ -9358,6 +9391,9 @@ msgstr ""
msgid "Subgroups and projects"
msgstr ""
msgid "Subkeys"
msgstr ""
msgid "Submit as spam"
msgstr ""
@ -9906,6 +9942,18 @@ msgstr ""
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr ""
msgid "There are no GPG keys associated with this account."
msgstr ""
msgid "There are no GPG keys with access to your account."
msgstr ""
msgid "There are no SSH keys associated with this account."
msgstr ""
msgid "There are no SSH keys with access to your account."
msgstr ""
msgid "There are no archived projects yet"
msgstr ""
@ -10405,6 +10453,9 @@ msgstr ""
msgid "Title"
msgstr ""
msgid "Title:"
msgstr ""
msgid "Titles and Filenames"
msgstr ""
@ -11619,6 +11670,9 @@ msgstr ""
msgid "Your Conversational Development Index gives an overview of how you are using GitLab from a feature perspective. View how you compare with other organizations, discover features you are not using, and learn best practices through blog posts and white papers."
msgstr ""
msgid "Your GPG keys (%{count})"
msgstr ""
msgid "Your Groups"
msgstr ""
@ -11631,6 +11685,9 @@ msgstr ""
msgid "Your Projects' Activity"
msgstr ""
msgid "Your SSH keys (%{count})"
msgstr ""
msgid "Your Todos"
msgstr ""