Skip to content

Commit

Permalink
Update the alias strings to use FTL plural logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxcrawford committed May 28, 2021
1 parent 236705a commit 9fac97d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
16 changes: 9 additions & 7 deletions privaterelay/locales/en-us/privaterelay/app.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ banner-choose-subdomain-label = Your domain is:
# $subdomain (url) - User-set subdomain
banner-choose-subdomain-label = You can make up any address @{ $subdomain }
# Variables:
# $number (number) - User-set subdomain
remaining-aliases-promo-label = { $number } aliases. You can make unlimited!
remaining-aliases-label-html = <span>1</span> remaining alias
remaining-aliases-promo-label = { $number ->
[one] { $number } remaining alias.
*[other] { $number } remaining aliases.
}
remaining-aliases-promo-label-unlimited = { $number ->
[one] { $number } alias. You can make unlimited!
*[other] { $number } aliases. You can make unlimited!
}
# Variables:
# $number (number) - Number of remaining aliases. This will always be more than 1.
remaining-aliases-label-plural-html = <span>{ $number }</span> remaining aliases
remaining-aliases-cta = Buy unlimited aliases
onboarding-headline = Three ways to create an alias
onboarding-tip-1 = Right here - just select the button in the upper right corner
Expand Down
8 changes: 2 additions & 6 deletions privaterelay/templates/includes/remaining-aliases.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
<span class="num-remaining-aliases bold">
{% with request.user.profile_set.first as user_profile %}
{% if settings.PREMIUM_ENABLED and user_profile.has_unlimited %}
{% ftlmsg 'remaining-aliases-promo-label' number=relay_addresses|length %}
{% ftlmsg 'remaining-aliases-promo-label-unlimited' number=relay_addresses|length %}
{% else %}
{% if relay_addresses|length == 4 %}
{% ftlmsg 'remaining-aliases-label-html' %}
{% else %}
{% ftlmsg 'remaining-aliases-label-plural-html' number=remaining_free_aliases_count %}
{% endif %}
{% ftlmsg 'remaining-aliases-promo-label' number=remaining_free_aliases_count %}
{% if settings.PREMIUM_ENABLED %}
<a href="https://accounts.stage.mozaws.net/subscriptions/products/{{ settings.PREMIUM_PROD_ID }}?plan={{ settings.PREMIUM_PRICE_ID }}" target="_blank">{% ftlmsg 'remaining-aliases-cta' %}</a>
{% endif %}
Expand Down

0 comments on commit 9fac97d

Please sign in to comment.