Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6405 Fix wcag annotations #7314

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<a href="#close" class="external" aria-label="{{ gettext('Close') }}"></a>
<dialog open id="delete-confirm-menu-dialog" aria-labelledby="confirm-heading">
<h2 id="confirm-heading" class="paragraph-spacing">
{{ gettext('When the account for a source is deleted:') }}
{{ gettext('When the account for a <abr title="user">source</abr>is deleted:') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT the tag should be <abbr title="..."> not <abr title="..."> - unsure if both are valid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked it up and both are valid - https://www.w3schools.com/tags/tag_abbr.asp

</h2>
<ul>
<li>{{ gettext('The source will no longer be able to log in with their codename.') }}</li>
<li>{{ gettext('The <abr title="user">source</abr> will no longer be able to log in with their <abbr title="user name">codename</abbr>.') }}</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear that terms like source and codename are ones that should have an abbr tag (vs the OATH-HOTP instance below, which definitely should!) - is there a reason they're included?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why I thought it would be nice to have was because its a bit unclear as a new user what a codename is as its a term used specifically by the app. Let me know if I need to update @zenmonkeykstop

<li>{{ gettext('You will not be able to send them replies.') }}</li>
<li>{{ gettext('All files and messages from that source will also be destroyed.') }}</li>
<li>{{ gettext('All files and messages from that <abr title="user">source</abr> will also be destroyed.') }}</li>
</ul>
<p class="modal-danger-text">{{ gettext('Are you sure this is what you want?') }}</p>
<div class="btn-row">
<a href="#close" id="cancel-collections-deletions" title="{{ gettext('Cancel') }}"
class="btn cancel small">{{ gettext('Cancel') }}</a>
<button type="submit" id="delete-collections-confirm" name="action" value="delete"
class="btn small danger">{{ gettext('Yes, Delete Selected Source Accounts') }}</button>
class="btn small danger">{{ gettext('Yes, Delete Selected <abr title="user">Source</abr> Accounts') }}</button>
</div>
</dialog>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block tab_title %}{{ gettext('Enable YubiKey (OATH-HOTP)') }}{% endblock %}

{% block body %}
<h1>{{ gettext('Enable YubiKey (OATH-HOTP)') }}</h1>
<h1>{{ gettext('Enable YubiKey (<abbr title="HMAC-based one-time password algorithm">OATH-HOTP</abbr>)') }}</h1>
<p>{{ gettext('Once you have configured your YubiKey, enter the 6-digit verification code below:') }}</p>
<form id="check-token" method="post" action="{{url_for('account.new_two_factor_hotp')}}">
<input name="csrf_token" type="hidden" value="{{ csrf_token() }}">
Expand Down
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h2 id="users-heading" class="visually-hidden">Users</h2>

<a href="{{ url_for('admin.manage_config') }}" class="btn icon icon-edit section-spacing-inline"
id="update-instance-config" aria-label="{{ gettext('Update instance configuration') }}">
{{ gettext('INSTANCE CONFIG') }}
{{ gettext('INSTANCE CONFIGURATION') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably out of scope for WCAG annotations and will require translation changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, sounds good - will remove for now

</a>

{% endblock %}
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/col.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h2 id="replies-heading">{{ gettext('Reply') }}</h2>
Deleting the account for <b>{source}</b> will:
</p>
<ul>
<li>prevent them from logging in with their codename again
<li>prevent them from logging in with their <abr title="user name">codename</abr>again
<li>prevent your organization from sending replies
</ul>
<p>
Expand Down
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2 id="config-preventuploads">{{ gettext('Submission Preferences') }}</h2>
<div class="config_form_element">
{{ submission_preferences_form.reject_codename_messages() }}
<label
for="reject_codename_messages">{{ gettext('Prevent sources from submitting their codename as an initial message.') }}</label>
for="reject_codename_messages">{{ gettext('Prevent sources from submitting their <abr title="user name">codename</abr>as an initial message.') }}</label>
</div>
<div class="section-spacing">
<button type="submit" id="submit-submission-preferences" class="icon icon-edit"
Expand Down
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/js-strings.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{# Hack around doing full JS translation support since JS is barely used #}
<div id="js-strings">
<div id="filter-by-codename-placeholder-string" hidden>{{ gettext('Filter by codename') }}</div>
<div id="filter-by-codename-placeholder-string" hidden>{{ gettext('Filter by <abr title="user name">codename</abr>') }}</div>
<div id="select-all-string" hidden>{{ gettext('Select All') }}</div>
<div id="select-unread-string" hidden>{{ gettext('Select Unread') }}</div>
<div id="select-none-string" hidden>{{ gettext('Select None') }}</div>
Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ <h2>{{ gettext('Server error') }}</h2>

<p>{{ gettext('Sorry, the website encountered an error and was unable to complete your request.') }}</p>

<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a codename...') }}</a></p>
<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a <abr title="user name">codename</abr>...') }}</a></p>
{% endblock %}
6 changes: 3 additions & 3 deletions securedrop/source_templates/generate.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
{% import 'utils.html' as utils %}

{% block body %}
<h2>{{ gettext('Get Your Codename') }}</h2>
<h2>{{ gettext('Get Your <abr title="user name">codename</abr>') }}</h2>

<p id="codename-explanation" class="explanation">
{{ gettext('A <em>codename</em> in SecureDrop functions as both your username and your password.') }}
{{ gettext('A <em><abr title="user name">codename</abr></em> in SecureDrop functions as both your username and your password.') }}
</p>
<p class="explanation">
{{ gettext('You will need this codename to log into our SecureDrop later:') }}
{{ gettext('You will need this <abr title="user name">codename</abr> to log into our SecureDrop later:') }}
</p>

{{ utils.codename(codename) }}
Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h2 id="first-submission-heading">{{ gettext('First submission') }}</h2>

<section id="return-visit" aria-labelledby="return-visit-heading">
<h2 id="return-visit-heading">{{ gettext('Return visit') }}</h2>
<p>{{ gettext('Already have a codename? Check for replies or submit something new.') }}</p>
<p>{{ gettext('Already have a <abr title="user name">codename</abr>? Check for replies or submit something new.') }}</p>
<a href="{{ url_for('main.login') }}" class="btn secondary"
aria-label="{{ gettext('Log In Using Your Codename') }}">
{{ gettext('LOG IN') }}
Expand Down
6 changes: 3 additions & 3 deletions securedrop/source_templates/lookup.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ <h2 id="submit-heading">{{ gettext('Submit Messages') }}</h2>

<p>
{% if allow_document_uploads %}
{{ gettext('If you are already familiar with GPG, you can optionally encrypt your files and messages with our <a href="{url}" class="text-link">public key</a> before submission. Files are encrypted as they are received by SecureDrop.').format(url=url_for('info.download_public_key')) }}
{{ gettext('If you are already familiar with <abbr title="GNU Privacy Guard">GPG</abbr>, you can optionally encrypt your files and messages with our <a href="{url}" class="text-link">public key</a> before submission. Files are encrypted as they are received by SecureDrop.').format(url=url_for('info.download_public_key')) }}
{% else %}
{{ gettext('If you are already familiar with GPG, you can optionally encrypt your messages with our <a href="{url}" class="text-link">public key</a> before submission.').format(url=url_for('info.download_public_key')) }}
{{ gettext('If you are already familiar with <abbr title="GNU Privacy Guard">GPG</abbr>, you can optionally encrypt your messages with our <a href="{url}" class="text-link">public key</a> before submission.').format(url=url_for('info.download_public_key')) }}
{% endif %}
{{ gettext('<a href="{url}" class="text-link">Learn more</a>.').format(url=url_for('info.why_download_public_key')) }}
</p>
Expand Down Expand Up @@ -78,7 +78,7 @@ <h2 id="replies-heading">{{ gettext('Read Replies') }}</h2>
<div id="replies">
{% if replies %}
<p class="info">
{{ gettext("You have received a reply. To protect your identity in the unlikely event someone learns your codename, please delete all replies when you're done with them. This also lets us know that you are aware of our reply. You can respond by submitting new files and messages above.") }}
{{ gettext("You have received a reply. To protect your identity in the unlikely event someone learns your <abr title="user name">codename</abr>, please delete all replies when you're done with them. This also lets us know that you are aware of our reply. You can respond by submitting new files and messages above.") }}
</p>
{% for reply in replies %}
{%- set timestamp = utils.relative_time(reply.date) -%}
Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/notfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ <h2>{{ gettext('Page not found') }}</h2>

<p id="page-not-found">{{ gettext("Sorry, we couldn't locate what you requested.") }}</p>

<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a codename...') }}</a></p>
<p><a href="{{ url_for('main.login') }}">{{ gettext('Look up a <abr title="user name">codename</abr>...') }}</a></p>
{% endblock %}
8 changes: 4 additions & 4 deletions securedrop/source_templates/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
{%- macro codename(codename, new=False) -%}
{% if new %}
<section aria-labelledby="codename-reminder">
<p id="codename-reminder">{{ gettext('Remember, your codename is:') }}</p>
<p id="codename-reminder">{{ gettext('Remember, your <abbr title="user name">codename</abbr> is:') }}</p>
{% else %}
<section aria-labelledby="codename-heading">
<h2 id="codename-heading" hidden>{{ gettext('Codename') }}</h2>
<h2 id="codename-heading" hidden>{{ gettext('<abbr title="user name">Codename</abbr>') }}</h2>
{% endif %}

<input id="codename-show-checkbox" type="checkbox" role="button"{% if not new %} checked {% endif -%}
aria-label="{{ gettext('Reveal Codename') }}" aria-controls="codename">

<mark id="codename" lang="en-US" dir="ltr"{% if not new %}
aria-describedby="codename-instructions codename-explanation"{% endif %}><span>{{ codename }}</span></mark>
aria-describedby="codename-instructions codename-explanation"{% endif %}><span>{{ <abbr title="user name">codename</abbr> }}</span></mark>

<label for="codename-show-checkbox" id="codename-show"
aria-hidden="true">
{{ gettext('Show Codename') }}
{{ gettext('Show <abbr title="user name">Codename</abbr>') }}
</label>

</section>
Expand Down
4 changes: 2 additions & 2 deletions securedrop/source_templates/why-public-key.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<h2>{{ gettext("Why download the team's public key?") }}</h2>
<p>{{ gettext("SecureDrop encrypts files and messages after they are submitted. Encrypting messages and files before submission can provide an extra layer of security before your data reaches the SecureDrop server.") }}
</p>
<p>{{ gettext("If you are already familiar with the GPG encryption software, you may wish to encrypt your submissions yourself. To do so:") }}
<p>{{ gettext("If you are already familiar with the <abbr title="GNU Privacy Guard">GPG</abbr> encryption software, you may wish to encrypt your submissions yourself. To do so:") }}
<ol>
<li>{{ gettext('<a href="{url}">Download</a> the public key. It will be saved to a file called:
<p><code>{submission_key_fpr_filename}</code></p>').format(url=url_for('info.download_public_key'), submission_key_fpr_filename=submission_key_fpr + '.asc')|safe }}
</li>
<li>{{ gettext('Import it into your GPG keyring.') }}
<li>{{ gettext('Import it into your <abbr title="GNU Privacy Guard">GPG</abbr> keyring.') }}
<ul>
<li>{{ gettext('If you are using <a href="{url}">Tails</a>, you can double-click the <code>.asc</code> file you just downloaded and it will be automatically imported to your keyring.').format(url='https://tails.boum.org') }}
</li>
Expand Down