Commit c3fc7b50 authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch 'jh-hide_banner_before_eligible' into 'master'

Update copy in self-managed expiry messages

See merge request gitlab-org/gitlab!69415
parents 342186c7 75c1a14d
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
= link_to _('Upgrade your plan'), upgrade_subscription_path, class: 'btn gl-button btn-confirm', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'upgrade' } = link_to _('Upgrade your plan'), upgrade_subscription_path, class: 'btn gl-button btn-confirm', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'upgrade' }
- else - else
= link_to _('Renew subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'renew' } = link_to _('Renew subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'renew' }
= link_to _('That is ok, I do not want to renew'), '#', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2' = link_to _("That's OK, I don't want to renew"), '#', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2'
...@@ -52,7 +52,11 @@ module Gitlab ...@@ -52,7 +52,11 @@ module Gitlab
end end
def expiring_subject def expiring_subject
_('Your subscription will expire in %{remaining_days}.') % { remaining_days: remaining_days_formatted } n_(
'Your subscription will expire in %{remaining_days} day.',
'Your subscription will expire in %{remaining_days} days.',
remaining_days
) % { remaining_days: remaining_days }
end end
def expiration_blocking_message def expiration_blocking_message
...@@ -66,7 +70,11 @@ module Gitlab ...@@ -66,7 +70,11 @@ module Gitlab
def expired_message def expired_message
return block_changes_message if show_downgrade_messaging? return block_changes_message if show_downgrade_messaging?
_('No worries, you can still use all the %{strong}%{plan_name}%{strong_close} features for now. You have %{remaining_days} to renew your subscription.') % { plan_name: plan_name, remaining_days: remaining_days_formatted, strong: strong, strong_close: strong_close } n_(
'No worries, you can still use all the %{strong}%{plan_name}%{strong_close} features for now. You have %{remaining_days} day to renew your subscription.',
'No worries, you can still use all the %{strong}%{plan_name}%{strong_close} features for now. You have %{remaining_days} days to renew your subscription.',
remaining_days
) % { plan_name: plan_name, remaining_days: remaining_days, strong: strong, strong_close: strong_close }
end end
def block_changes_message def block_changes_message
...@@ -88,7 +96,7 @@ module Gitlab ...@@ -88,7 +96,7 @@ module Gitlab
def expiring_message def expiring_message
return namespace_expiring_message if namespace return namespace_expiring_message if namespace
_('Your %{strong}%{plan_name}%{strong_close} subscription will expire on %{strong}%{expires_on}%{strong_close}. After that, you will not be able to create issues or merge requests as well as many other features.') % { expires_on: expires_at_or_cutoff_at.strftime("%Y-%m-%d"), plan_name: plan_name, strong: strong, strong_close: strong_close } _('Your %{strong}%{plan_name}%{strong_close} subscription expires on %{strong}%{expires_on}%{strong_close}. After that date, you cannot create issues or merge requests, or use many other features.') % { expires_on: expires_at_or_cutoff_at.strftime("%Y-%m-%d"), plan_name: plan_name, strong: strong, strong_close: strong_close }
end end
def namespace_expiring_message def namespace_expiring_message
...@@ -198,17 +206,15 @@ module Gitlab ...@@ -198,17 +206,15 @@ module Gitlab
end end
end end
def remaining_days_formatted def remaining_days
strong_memoize(:remaining_days_formatted) do strong_memoize(:remaining_days) do
days = if expired_but_within_cutoff? days = if expired_but_within_cutoff?
(subscribable.block_changes_at - Date.today).to_i (subscribable.block_changes_at - Date.today).to_i
else else
(expires_at_or_cutoff_at - Date.today).to_i (expires_at_or_cutoff_at - Date.today).to_i
end end
days = days < 0 ? 0 : days days < 0 ? 0 : days
pluralize(days, 'day')
end end
end end
end end
......
...@@ -193,7 +193,7 @@ RSpec.describe Gitlab::ExpiringSubscriptionMessage do ...@@ -193,7 +193,7 @@ RSpec.describe Gitlab::ExpiringSubscriptionMessage do
context 'without namespace' do context 'without namespace' do
it 'has an expiration blocking message' do it 'has an expiration blocking message' do
expect(subject).to include("Your #{plan_name.capitalize} subscription will expire on 2020-03-09. After that, you will not be able to create issues or merge requests as well as many other features.") expect(subject).to include("Your #{plan_name.capitalize} subscription expires on 2020-03-09. After that date, you cannot create issues or merge requests, or use many other features.")
end end
end end
......
...@@ -22888,8 +22888,10 @@ msgstr "" ...@@ -22888,8 +22888,10 @@ msgstr ""
msgid "No webhooks found, add one in the form above." msgid "No webhooks found, add one in the form above."
msgstr "" msgstr ""
msgid "No worries, you can still use all the %{strong}%{plan_name}%{strong_close} features for now. You have %{remaining_days} to renew your subscription." msgid "No worries, you can still use all the %{strong}%{plan_name}%{strong_close} features for now. You have %{remaining_days} day to renew your subscription."
msgstr "" msgid_plural "No worries, you can still use all the %{strong}%{plan_name}%{strong_close} features for now. You have %{remaining_days} days to renew your subscription."
msgstr[0] ""
msgstr[1] ""
msgid "No. of commits" msgid "No. of commits"
msgstr "" msgstr ""
...@@ -33230,7 +33232,7 @@ msgstr "" ...@@ -33230,7 +33232,7 @@ msgstr ""
msgid "Thanks for your purchase!" msgid "Thanks for your purchase!"
msgstr "" msgstr ""
msgid "That is ok, I do not want to renew" msgid "That's OK, I don't want to renew"
msgstr "" msgstr ""
msgid "That's it, well done!" msgid "That's it, well done!"
...@@ -38771,10 +38773,10 @@ msgstr "" ...@@ -38771,10 +38773,10 @@ msgstr ""
msgid "Your %{host} account was signed in to from a new location" msgid "Your %{host} account was signed in to from a new location"
msgstr "" msgstr ""
msgid "Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}." msgid "Your %{strong}%{plan_name}%{strong_close} subscription expires on %{strong}%{expires_on}%{strong_close}. After that date, you cannot create issues or merge requests, or use many other features."
msgstr "" msgstr ""
msgid "Your %{strong}%{plan_name}%{strong_close} subscription will expire on %{strong}%{expires_on}%{strong_close}. After that, you will not be able to create issues or merge requests as well as many other features." msgid "Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}."
msgstr "" msgstr ""
msgid "Your CI/CD configuration syntax is invalid. View Lint tab for more details." msgid "Your CI/CD configuration syntax is invalid. View Lint tab for more details."
...@@ -39053,8 +39055,10 @@ msgstr "" ...@@ -39053,8 +39055,10 @@ msgstr ""
msgid "Your subscription has been downgraded." msgid "Your subscription has been downgraded."
msgstr "" msgstr ""
msgid "Your subscription will expire in %{remaining_days}." msgid "Your subscription will expire in %{remaining_days} day."
msgstr "" msgid_plural "Your subscription will expire in %{remaining_days} days."
msgstr[0] ""
msgstr[1] ""
msgid "Your username is %{username}." msgid "Your username is %{username}."
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