diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-08-16 15:15:54 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-08-25 19:43:21 +0300 |
commit | 08c0a1b8527287457cb8db5f41c368af192c606b (patch) | |
tree | 2534ee8c44c34213d4d82cb8aad0d61fa326b78f /app/views/projects/_issuable_by_email.html.haml | |
parent | 842377ab3c5b80a3758ad8c36dc3358bd265bc10 (diff) |
Reject ruby interpolation in externalized strings
When using ruby interpolation in externalized strings, they can't be
detected. Which means they will never be presented to be translated.
To mix variables into translations we need to use `sprintf`
instead.
Instead of:
_("Hello #{subject}")
Use:
_("Hello %{subject}) % { subject: 'world' }
Diffstat (limited to 'app/views/projects/_issuable_by_email.html.haml')
-rw-r--r-- | app/views/projects/_issuable_by_email.html.haml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/views/projects/_issuable_by_email.html.haml b/app/views/projects/_issuable_by_email.html.haml index 22adf5b4008..d59191a6f87 100644 --- a/app/views/projects/_issuable_by_email.html.haml +++ b/app/views/projects/_issuable_by_email.html.haml @@ -19,9 +19,16 @@ = text_field_tag :issuable_email, email, class: "monospace js-select-on-focus form-control", readonly: true .input-group-append = clipboard_button(target: '#issuable_email', class: 'btn btn-clipboard input-group-text btn-transparent d-none d-sm-block') + + - if issuable_type == 'issue' + - enter_title_text = _('Enter the issue title') + - enter_description_text = _('Enter the issue description') + - else + - enter_title_text = _('Enter the merge request title') + - enter_description_text = _('Enter the merge request description') = mail_to email, class: 'btn btn-clipboard btn-transparent', - subject: _("Enter the #{name} title"), - body: _("Enter the #{name} description"), + subject: enter_title_text, + body: enter_description_text, title: _('Send email'), data: { toggle: 'tooltip', placement: 'bottom' } do = sprite_icon('mail') |