From 1b86147ab610b08cd269c5feb659770b306672f3 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Thu, 8 Aug 2019 11:39:57 -0400 Subject: [PATCH] Move text into translations file --- templates/ccpo/add_user.html | 4 ++-- templates/ccpo/confirm_user.html | 18 +++++++++++------- templates/ccpo/users.html | 10 +++++----- tests/routes/test_ccpo.py | 2 +- translations.yaml | 17 +++++++++++++++-- 5 files changed, 34 insertions(+), 17 deletions(-) diff --git a/templates/ccpo/add_user.html b/templates/ccpo/add_user.html index 81690e0f..15dfed75 100644 --- a/templates/ccpo/add_user.html +++ b/templates/ccpo/add_user.html @@ -5,7 +5,7 @@ {% block content %}
{{ form.csrf_token }} -

Add new CCPO user

+

{{ "ccpo.form.add_user_title" | translate }}

{{ TextInput(form.dod_id, validation='dodId') }} @@ -16,7 +16,7 @@ type='submit' v-bind:disabled="invalid" class='action-group__action usa-button' - value='Next'> + value='{{ "common.next" | translate }}'> {{ "common.cancel" | translate }}
diff --git a/templates/ccpo/confirm_user.html b/templates/ccpo/confirm_user.html index 150d25fd..5c54086d 100644 --- a/templates/ccpo/confirm_user.html +++ b/templates/ccpo/confirm_user.html @@ -5,13 +5,13 @@ {% block content %} {% if new_user %} - {% call Alert('Confirm new CCPO user') %} + {% call Alert('ccpo.form.confirm_user_title' | translate) %} {{ form.csrf_token }}

- Please confirm that the user details below match the user being given CCPO permissions. + {{ "ccpo.form.confirm_user_text" | translate }}

{{ new_user.full_name }} @@ -25,17 +25,21 @@ type='submit' v-bind:disabled="invalid" class='action-group__action usa-button' - value='Confirm and Add User'> - {{ "common.cancel" | translate }} + value='{{ "ccpo.form.confirm_button" | translate }}'> + + {{ "common.cancel" | translate }} +

{% endcall %} {% else %} - {% call Alert('forms.ccpo_user.user_not_found' | translate) %} - To add someone as a CCPO user, they must already have an ATAT account. + {% call Alert('ccpo.form.user_not_found_title' | translate) %} +

+ {{ "ccpo.form.user_not_found_text" | translate }} +

- Return to list of CCPO users + {{ "ccpo.form.return_link" | translate }}
{% endcall %} diff --git a/templates/ccpo/users.html b/templates/ccpo/users.html index 891ceb7a..9e4c0fab 100644 --- a/templates/ccpo/users.html +++ b/templates/ccpo/users.html @@ -5,7 +5,7 @@ {% block content %}
- CCPO Users + {{ "ccpo.users_title" | translate }}
{% include "fragments/flash.html" %} @@ -13,9 +13,9 @@ - - - + + + @@ -32,7 +32,7 @@ {% if user_can(permissions.CREATE_CCPO_USER) %} - Add new CCPO user {{ Icon("plus") }} + {{ "ccpo.add_user" | translate }} {{ Icon("plus") }} {% endif %} diff --git a/tests/routes/test_ccpo.py b/tests/routes/test_ccpo.py index 8129408f..1e22e5b8 100644 --- a/tests/routes/test_ccpo.py +++ b/tests/routes/test_ccpo.py @@ -28,7 +28,7 @@ def test_submit_add_new_ccpo_user(user_session, client): response = client.post( url_for("ccpo.submit_add_new_ccpo_user"), data={"dod_id": random_dod_id} ) - assert translate("forms.ccpo_user.user_not_found") in response.data.decode() + assert translate("ccpo.form.user_not_found_title") in response.data.decode() def test_confirm_new_ccpo_user(user_session, client): diff --git a/translations.yaml b/translations.yaml index 0a4f9dcf..73b71951 100644 --- a/translations.yaml +++ b/translations.yaml @@ -26,6 +26,20 @@ home: applications_descrip: ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod reports_descrip: enim ad minim veniam, quis nostrud exercitation ullamco admin_descrip: aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat +ccpo: + users_title: CCPO Users + name_heading: Name + email_heading: Email + dod_id_heading: DoD ID + add_user: Add new CCPO user + form: + add_user_title: Add new CCPO user + confirm_user_title: Confirm new CCPO user + confirm_user_text: Please confirm that the user details below match the user being given CCPO permissions. + confirm_button: Confirm and Add User + return_link: Return to list of CCPO users + user_not_found_title: User not found + user_not_found_text: To add someone as a CCPO user, they must already have an ATAT account. common: cancel: Cancel close: Close @@ -36,6 +50,7 @@ common: delete_confirm: 'Please type the word {word} to confirm:' edit: Edit members: Members + next: Next 'yes': 'Yes' 'no': 'No' response_label: Response required @@ -103,8 +118,6 @@ forms: name_label: Name assign_ppoc: dod_id: 'Select new primary point of contact:' - ccpo_user: - user_not_found: "User not found" environments: name_label: Environment Name edit_user:
NameEmailDoD ID{{ "ccpo.name_heading" | translate }}{{ "ccpo.email_heading" | translate }}{{ "ccpo.dod_id_heading" | translate }}