Skip to content

Commit

Permalink
Clarify annual timeframes are based on the fiscal year (#1761)
Browse files Browse the repository at this point in the history
* Update /monthly & /template-usage

* Update service settings

* Update set-email page

* Update set-sms page

* Update set-sms-message-limit page

* Fix tests, correct a translation

* Correct FR translation in service-settings/set-sms

* Formatting

* Revert accidental commit

* One more translation fix..

* FR translation fix....Each, per, which one is it?
  • Loading branch information
whabanks authored Feb 21, 2024
1 parent 51ca90c commit a3c6608
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ class SMSMessageLimit(StripWhitespaceForm):

class FreeSMSAllowance(StripWhitespaceForm):
free_sms_allowance = IntegerField(
_l("Numbers of text messages per year"),
_l("Numbers of text messages per fiscal year"),
validators=[DataRequired(message=_l("This cannot be empty"))],
)

Expand Down
2 changes: 1 addition & 1 deletion app/main/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def get_tuples_of_financial_years(
) -> list:
return list(
(
_l("financial year"),
_l("fiscal year"),
year,
partial_url(year=year),
"{} {} {}".format(year, _("to"), year + 1),
Expand Down
6 changes: 3 additions & 3 deletions app/templates/views/service-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h2 class="heading-small p-0 m-0">{{ _('Your service is in trial mode') }}</h2>
{% endcall %}

{% call settings_row(if_has_permission='email') %}
{% set txt = _('Yearly maximum') %}
{% set txt = _('Annual maximum</br>(April 1 to March 31)') %}
{{ text_field(txt) }}
{% set annual_limit = _('{} million emails').format((limits.free_yearly_email//1000000) | format_number) %}
{{ text_field(annual_limit) }}
Expand Down Expand Up @@ -264,7 +264,7 @@ <h2 class="heading-small p-0 m-0">{{ _('Your service is in trial mode') }}</h2>
{% endcall %}

{% call settings_row(if_has_permission='sms') %}
{% set txt = _('Yearly maximum') %}
{% set txt = _('Annual maximum</br>(April 1 to March 31)') %}
{{ text_field(txt) }}
{% set txt_msg_limit = _('{} text messages').format(limits.free_yearly_sms | format_number) %}
{{ text_field(txt_msg_limit) }}
Expand Down Expand Up @@ -417,7 +417,7 @@ <h2 class="heading-medium">{{ _('Platform admin settings') }}</h2>
{% endcall %}

{% call row() %}
{% set txt = _('Free text messages per year') %}
{% set txt = _('Free text messages per fiscal year') %}
{{ text_field(txt)}}
{{ text_field(current_service.free_sms_fragment_limit | format_number) }}
{{ edit_field(
Expand Down
2 changes: 1 addition & 1 deletion app/templates/views/service-settings/set-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
back_link=url_for('main.service_settings', service_id=current_service.id)
) }}
<p>
{{ _("You can send up to {} million emails per year for free.").format((limits.free_yearly_email//1000000) | format_number) }}
{{ _("You can send up to {} million emails per fiscal year for free.").format((limits.free_yearly_email//1000000) | format_number) }}
</p>
{% call form_wrapper() %}
{% set save_txt = _('Save') %}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/views/service-settings/set-sms.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
back_link=url_for('main.service_settings', service_id=current_service.id)
) }}
<p>
{{ _('You have a free allowance of') }}
{{ limits.free_yearly_sms | format_number }} {{ _('text messages each financial year.') }}
{{ _('You can send up to') }}
{{ limits.free_yearly_sms | format_number }} {{ _('text messages per fiscal year.') }}
</p>
{% call form_wrapper() %}
{{ radios(form.enabled) }}
Expand Down
13 changes: 6 additions & 7 deletions app/translations/csv/fr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"Domain names","Noms de domaines"
"Who runs this service?","Qui assure la gestion du service?"
"What’s your key called?","Quel est le nom de votre clé?"
"Numbers of text messages per year","Nombre de messages texte par année"
"Numbers of text messages per fiscal year","Nombre de messages texte par exercice financier"
"Enter password","Entrez votre mot de passe"
"Invalid password","Mot de passe non valide"
"Template name","Nom du gabarit"
Expand Down Expand Up @@ -149,7 +149,6 @@
"November","Novembre"
"December","Décembre"
"Invalid month","Mois non valide"
"financial year","exercice financier"
"to","à"
"Invite sent to","Invitation envoyée à"
"(Default)","(Par défaut)"
Expand Down Expand Up @@ -638,7 +637,7 @@
"Count in list of live services","Compte dans la liste de services activés"
"Organisation","Organisation"
"Free text message allowance","Nombre de messages texte gratuits"
"Free text messages per year","Allocation annuelle de messages texte"
"text messages per fiscal year","Allocation de messages texte par exercice financier"
"Letter branding","Image de marque de la lettre"
"Data retention","Rétention des données"
"{}",""
Expand Down Expand Up @@ -982,8 +981,8 @@
"French Government of Canada signature","Signature du gouvernement du Canada en français"
"English Government of Canada signature","Signature du gouvernement du Canada en anglais"
"Charges may apply for messages sent to international phone numbers.","Des frais pourraient s’appliquer aux messages envoyés à des numéros de téléphone internationaux."
"You have a free allowance of","Vous disposez de"
"text messages each financial year.","messages texte gratuits par exercice financier."
"You can send up to","Vous pouvez envoyer jusqu’à"
"text messages per fiscal year.","messages texte par exercice financier."
"You have not added any text message senders yet","Vous n’avez ajouté aucun expéditeur de message texte à ce jour"
"Add text message sender","Ajouter un expéditeur de message texte"
"The text message sender tells your users who the message is from.","L’expéditeur de message texte fait savoir à vos utilisateurs d’où vient le message."
Expand Down Expand Up @@ -1463,7 +1462,7 @@
"{} million emails","{} millions de courriels"
"{} text messages","{} messages texte"
"Yearly free maximum","Maximum gratuit annuel"
"You can send up to {} million emails per year for free.","Vous pouvez envoyer jusqu’à {} millions de courriels gratuitement par année."
"You can send up to {} million emails per fiscal year for free.","Vous pouvez envoyer jusqu’à {} millions de courriels gratuitement par exercice financier."
"External link","Lien externe"
"Separator","Séparateur"
"Trial","Mode d'essai"
Expand Down Expand Up @@ -1746,7 +1745,7 @@
"GC Notify's email provider could suspend our services if we send too many problem emails. Check email addresses are correct. If necessary, confirm recipients’ email address using another contact method. Remove addresses you cannot correct.","Si nous envoyons trop de courriels à des adresses problématiques, le fournisseur de messagerie de Notification GC risque de suspendre nos services. Vérifiez que les adresses courriel sont correctes. Si cela est nécessaire, confirmez l’adresse courriel du ou de la destinataire en contactant cette personne d’une autre façon. Supprimez les adresses que vous ne pouvez pas corriger."
"To learn how, read the guide <a href='{}'>Updating contact information.</a>","Pour savoir comment faire, lisez le guide <a href='{}'>Maintenir à jour les coordonnées</a>"
"Daily maximum","Maximum quotidien"
"Yearly maximum","Maximum annuel"
"Annual maximum</br>(April 1 to March 31)","Maximum par exercice financier"
"To request a daily limit above {} emails, {}","Si vous désirez obtenir une limite quotidienne supérieure à {} courriels, veuillez {}"
"To request a daily limit above {} text messages, {}","Si vous désirez obtenir une limite quotidienne supérieure à {} messages texte, veuillez {}"
"You can try sending these messages after {} Eastern Time. Check your {}.","Vous pourrez envoyer ces messages après {} heures, heure de l’Est. Comparez {}"
Expand Down
16 changes: 8 additions & 8 deletions tests/app/main/views/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test_should_show_recent_templates_on_dashboard(
assert "100" in table_rows[1].find_all("td")[0].text


@freeze_time("2016-07-01 12:00") # 4 months into 2016 financial year
@freeze_time("2016-07-01 12:00") # 4 months into 2016 fiscal year
@pytest.mark.parametrize(
"extra_args",
[
Expand All @@ -277,7 +277,7 @@ def test_should_show_redirect_from_template_history(
)


@freeze_time("2016-07-01 12:00") # 4 months into 2016 financial year
@freeze_time("2016-07-01 12:00") # 4 months into 2016 fiscal year
@pytest.mark.parametrize(
"extra_args, template_label",
[
Expand Down Expand Up @@ -356,7 +356,7 @@ def test_stats_pages_show_last_3_years(
)

assert normalize_spaces(page.select_one(".pill").text) == (
"2012 to 2013 financial year " "2013 to 2014 financial year " "2014 to 2015 financial year"
"2012 to 2013 fiscal year " "2013 to 2014 fiscal year " "2014 to 2015 fiscal year"
)


Expand Down Expand Up @@ -654,8 +654,8 @@ def test_usage_page(
nav = page.find("ul", {"class": "pill", "role": "nav"})
nav_links = nav.find_all("a")

assert normalize_spaces(nav_links[0].text) == "2010 to 2011 financial year"
assert normalize_spaces(nav.find("li", {"aria-selected": "true"}).text) == "2011 to 2012 financial year"
assert normalize_spaces(nav_links[0].text) == "2010 to 2011 fiscal year"
assert normalize_spaces(nav.find("li", {"aria-selected": "true"}).text) == "2011 to 2012 fiscal year"
assert normalize_spaces(nav["aria-label"]) == "Filter by year"
assert "252,190" in cols[1].text
assert "Text messages" in cols[1].text
Expand Down Expand Up @@ -697,9 +697,9 @@ def test_usage_page_with_letters(
nav = page.find("ul", {"class": "pill", "role": "nav"})
nav_links = nav.find_all("a")

assert normalize_spaces(nav_links[0].text) == "2010 to 2011 financial year"
assert normalize_spaces(nav.find("li", {"aria-selected": "true"}).text) == "2011 to 2012 financial year"
assert normalize_spaces(nav_links[1].text) == "2012 to 2013 financial year"
assert normalize_spaces(nav_links[0].text) == "2010 to 2011 fiscal year"
assert normalize_spaces(nav.find("li", {"aria-selected": "true"}).text) == "2011 to 2012 fiscal year"
assert normalize_spaces(nav_links[1].text) == "2012 to 2013 fiscal year"
assert normalize_spaces(nav["aria-label"]) == "Filter by year"

assert "252,190" in cols[1].text
Expand Down
26 changes: 13 additions & 13 deletions tests/app/main/views/test_service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ def mock_get_service_settings_page_common(
"Email branding English Government of Canada signature Change",
"Send files by email Off (API-only) Change",
"Daily maximum 1,000 emails",
"Yearly maximum 10 million emails",
"Annual maximum(April 1 to March 31) 10 million emails",
"Label Value Action",
"Send text messages On Change",
"Start text messages with service name On Change",
"Send international text messages Off Change",
"Daily maximum 1,000 text messages",
"Yearly maximum 25,000 text messages",
"Annual maximum(April 1 to March 31) 25,000 text messages",
],
),
(
Expand All @@ -95,13 +95,13 @@ def mock_get_service_settings_page_common(
"Email branding English Government of Canada signature Change",
"Send files by email Off (API-only) Change",
"Daily maximum 1,000 emails",
"Yearly maximum 10 million emails",
"Annual maximum(April 1 to March 31) 10 million emails",
"Label Value Action",
"Send text messages On Change",
"Start text messages with service name On Change",
"Send international text messages Off Change",
"Daily maximum 1,000 text messages",
"Yearly maximum 25,000 text messages",
"Annual maximum(April 1 to March 31) 25,000 text messages",
"Label Value Action",
"Live On Change",
"Count in list of live services Yes Change",
Expand All @@ -111,7 +111,7 @@ def mock_get_service_settings_page_common(
"API rate limit per minute 100",
"Text message senders GOVUK Manage",
"Receive text messages Off Change",
"Free text messages per year 250,000 Change",
"Free text messages per fiscal year 250,000 Change",
"Email branding English Government of Canada signature Change",
"Data retention email Change",
"Receive inbound SMS Off Change",
Expand Down Expand Up @@ -229,13 +229,13 @@ def test_organisation_name_links_to_org_dashboard(
"Email branding Your branding (Organisation name) Change",
"Send files by email Off (API-only) Change",
"Daily maximum 1,000 emails",
"Yearly maximum 10 million emails",
"Annual maximum(April 1 to March 31) 10 million emails",
"Label Value Action",
"Send text messages On Change",
"Start text messages with service name On Change",
"Send international text messages On Change",
"Daily maximum 1,000 text messages",
"Yearly maximum 25,000 text messages",
"Annual maximum(April 1 to March 31) 25,000 text messages",
],
),
(
Expand All @@ -251,13 +251,13 @@ def test_organisation_name_links_to_org_dashboard(
"Email branding Your branding (Organisation name) Change",
"Send files by email Off (API-only) Change",
"Daily maximum 1,000 emails",
"Yearly maximum 10 million emails",
"Annual maximum(April 1 to March 31) 10 million emails",
"Label Value Action",
"Send text messages On Change",
"Start text messages with service name On Change",
"Send international text messages Off Change",
"Daily maximum 1,000 text messages",
"Yearly maximum 25,000 text messages",
"Annual maximum(April 1 to March 31) 25,000 text messages",
],
),
],
Expand Down Expand Up @@ -3063,7 +3063,7 @@ def test_should_show_page_to_set_sms_allowance(platform_admin_client, mock_get_f
assert response.status_code == 200
page = BeautifulSoup(response.data.decode("utf-8"), "html.parser")

assert normalize_spaces(page.select_one("label").text) == "Numbers of text messages per year"
assert normalize_spaces(page.select_one("label").text) == "Numbers of text messages per fiscal year"
mock_get_free_sms_fragment_limit.assert_called_once_with(SERVICE_ONE_ID)


Expand Down Expand Up @@ -3155,7 +3155,7 @@ def test_unknown_channel_404s(
),
(
"sms",
"You have a free allowance of 25,000 text messages each financial year.",
"You can send up to 25,000 text messages per fiscal year.",
"Send text messages",
[],
"False",
Expand All @@ -3164,7 +3164,7 @@ def test_unknown_channel_404s(
),
(
"email",
"You can send up to 10 million emails per year for free.",
"You can send up to 10 million emails per fiscal year for free.",
"Send emails",
[],
"False",
Expand All @@ -3173,7 +3173,7 @@ def test_unknown_channel_404s(
),
(
"email",
"You can send up to 10 million emails per year for free.",
"You can send up to 10 million emails per fiscal year for free.",
"Send emails",
["email", "sms", "letter"],
"True",
Expand Down

0 comments on commit a3c6608

Please sign in to comment.