From a6f147afa5021a30b3a8be345f8f406382f67f97 Mon Sep 17 00:00:00 2001 From: Brian Talbot <btalbot@edx.org> Date: Thu, 13 Feb 2014 10:27:40 -0500 Subject: [PATCH] LMS: revising modal UI to support translators --- lms/templates/dashboard.html | 76 ++++++++++++++++--- lms/templates/forgot_password_modal.html | 7 +- lms/templates/help_modal.html | 24 +++++- lms/templates/login_modal.html | 7 +- .../modal/_modal-settings-language.html | 15 +++- lms/templates/signup_modal.html | 7 +- 6 files changed, 118 insertions(+), 18 deletions(-) diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html index 13ab35fef9e..0db3c6a897a 100644 --- a/lms/templates/dashboard.html +++ b/lms/templates/dashboard.html @@ -277,10 +277,21 @@ <section id="email-settings-modal" class="modal" aria-hidden="true"> <div class="inner-wrapper" role="dialog" aria-labelledby="email-settings-title"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> - <h2 id="email-settings-title">${_('Email Settings for {course_number}').format(course_number='<span id="email_settings_course_number"></span>')}<span class="sr">, ${_("modal open")}</span></h2> + <h2 id="email-settings-title"> + ${_('Email Settings for {course_number}').format(course_number='<span id="email_settings_course_number"></span>')} + <span class="sr">, + ## Translators: this text gives status on if the modal interface (a menu or piece of UI that takes the full focus of the screen) is open or not + ${_("modal open")} + </span> + </h2> <hr/> </header> @@ -298,10 +309,21 @@ <section id="password_reset_complete" class="modal" aria-hidden="true"> <div class="inner-wrapper" role="dialog" aria-labelledby="password-reset-email"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> - <h2 id="password-reset-email">${_('Password Reset Email Sent')}<span class="sr">, ${_("modal open")}</span></h2> + <h2 id="password-reset-email"> + ${_('Password Reset Email Sent')} + <span class="sr">, + ## Translators: this text gives status on if the modal interface (a menu or piece of UI that takes the full focus of the screen) is open or not + ${_("modal open")} + </span> + </h2> <hr/> </header> <div> @@ -316,10 +338,21 @@ <section id="change_email" class="modal" aria-hidden="true"> <div class="inner-wrapper" role="dialog" aria-labelledby="change_email_title"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> - <h2><span id="change_email_title">${_("Change Email")}</span><span class="sr">, ${_("modal open")}</span></h2> + <h2> + <span id="change_email_title">${_("Change Email")}</span> + <span class="sr">, + ## Translators: this text gives status on if the modal interface (a menu or piece of UI that takes the full focus of the screen) is open or not + ${_("modal open")} + </span> + </h2> <hr/> </header> <div id="change_email_body"> @@ -348,10 +381,21 @@ <section id="apply_name_change" class="modal" aria-hidden="true"> <div class="inner-wrapper" role="dialog" aria-labelledby="change-name-title"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> - <h2 id="change-name-title">${_("Change your name")}<span class="sr">, ${_("modal open")}</span></h2> + <h2 id="change-name-title"> + ${_("Change your name")} + <span class="sr">, + ## Translators: this text gives status on if the modal interface (a menu or piece of UI that takes the full focus of the screen) is open or not + ${_("modal open")} + </span> + </h2> <hr/> </header> <div id="change_name_body"> @@ -377,9 +421,21 @@ <section id="unenroll-modal" class="modal unenroll-modal" aria-hidden="true"> <div class="inner-wrapper" role="alertdialog" aria-labelledy="unenrollment-modal-title"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> + <header> - <h2 id="unenrollment-modal-title">${_('<span id="track-info"></span> {course_number}? <span id="refund-info"></span>').format(course_number='<span id="unenroll_course_number"></span>')}<span class="sr">, ${_("modal open")}</span></h2> + <h2 id="unenrollment-modal-title"> + ${_('<span id="track-info"></span> {course_number}? <span id="refund-info"></span>').format(course_number='<span id="unenroll_course_number"></span>')} + <span class="sr">, + ## Translators: this text gives status on if the modal interface (a menu or piece of UI that takes the full focus of the screen) is open or not + ${_("modal open")} + </span> + </h2> <hr/> </header> <div id="unenroll_error" class="modal-form-error"></div> diff --git a/lms/templates/forgot_password_modal.html b/lms/templates/forgot_password_modal.html index 5c6fc8e9f0a..19893b97d7f 100644 --- a/lms/templates/forgot_password_modal.html +++ b/lms/templates/forgot_password_modal.html @@ -4,7 +4,12 @@ <%! from django.core.urlresolvers import reverse %> <section id="forgot-password-modal" class="modal" role="dialog" aria-label="${_('Password Reset')}"> <div class="inner-wrapper"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <div id="password-reset"> <header> diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html index 8dc7b6ef6c2..ad55e67a784 100644 --- a/lms/templates/help_modal.html +++ b/lms/templates/help_modal.html @@ -16,7 +16,13 @@ <section id="help-modal" class="modal" aria-hidden="true" role="dialog" aria-label="${_("{platform_name} Help").format(platform_name=MicrositeConfiguration.get_microsite_configuration_value("platform_name", settings.PLATFORM_NAME))}"> <div class="inner-wrapper" id="help_wrapper"> ## TODO: find a way to refactor this - <button class="close-modal "tabindex="0">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal "tabindex="0"> + ✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> <h2>${_('{span_start}{platform_name}{span_end} Help').format(span_start='<span class="edx">', span_end='</span>', platform_name=MicrositeConfiguration.get_microsite_configuration_value('platform_name', settings.PLATFORM_NAME))}</h2> @@ -54,7 +60,13 @@ discussion_link = get_discussion_link(course) if course else None </div> <div class="inner-wrapper" id="feedback_form_wrapper"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal"> + ✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header></header> @@ -82,7 +94,13 @@ discussion_link = get_discussion_link(course) if course else None </div> <div class="inner-wrapper" id="feedback_success_wrapper" tabindex="0"> - <button class="close-modal "tabindex="0">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal" tabindex="0"> + ✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> <h2>${_('Thank You!')}</h2> diff --git a/lms/templates/login_modal.html b/lms/templates/login_modal.html index fb425a11c3b..9cacaff51c3 100644 --- a/lms/templates/login_modal.html +++ b/lms/templates/login_modal.html @@ -5,7 +5,12 @@ <section id="login-modal" class="modal login-modal"> <div class="inner-wrapper"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> <h2>${_("Log In")}</h2> diff --git a/lms/templates/modal/_modal-settings-language.html b/lms/templates/modal/_modal-settings-language.html index 96c85cbfdb3..709e03a22a7 100644 --- a/lms/templates/modal/_modal-settings-language.html +++ b/lms/templates/modal/_modal-settings-language.html @@ -7,10 +7,21 @@ <section id="change_language" class="modal modal-settings-language" aria-hidden="true"> <div class="inner-wrapper" role="dialog" aria-labelledby="change_language_title"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <header> - <h2><span id="change_language_title">${_("Change Preferred Language")}</span><span class="sr">, ${_("modal open")}</span></h2> + <h2> + <span id="change_language_title">${_("Change Preferred Language")}</span> + <span class="sr">, + ## Translators: this text gives status on if the modal interface (a menu or piece of UI that takes the full focus of the screen) is open or not + ${_("modal open")} + </span> + </h2> <hr/> </header> <div id="change_language_body"> diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index f80c700c7c3..143e2e49d59 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -10,7 +10,12 @@ <section id="signup-modal" class="modal signup-modal"> <div class="inner-wrapper"> - <button class="close-modal">✕ <span class="sr">${_('Close Modal')}</span></button> + <button class="close-modal">✕ + <span class="sr"> + ## Translators: this is a control to allow users to exit out of this modal interface (a menu or piece of UI that takes the full focus of the screen) + ${_('Close Modal')} + </span> + </button> <div id="register"> <header> -- GitLab