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

Add accessibility attributes to loading spinner #2799

Merged
merged 1 commit into from
Apr 20, 2021
Merged
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
10 changes: 8 additions & 2 deletions js/src/common/components/LoadingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ export default class LoadingIndicator extends Component<LoadingIndicatorAttrs> {
attrs.containerClassName = classList({ 'LoadingIndicator-container': true, [attrs.containerClassName || '']: true });

return (
<div {...attrs.containerAttrs} data-size={size} className={attrs.containerClassName}>
<div {...attrs}></div>
<div
aria-label={app.translator.trans('core.lib.loading_indicator.accessible_label')}
role="status"
{...attrs.containerAttrs}
data-size={size}
className={attrs.containerClassName}
>
<div aria-hidden {...attrs} />
</div>
);
}
Expand Down
7 changes: 6 additions & 1 deletion locale/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ core:
permission_denied_message: You do not have permission to do that.
rate_limit_exceeded_message: You're going a little too quickly. Please try again in a few seconds.

# These translations are used in the loading indicator component.
loading_indicator:
accessible_label: => core.ref.loading

# These translations are used as suffixes when abbreviating numbers.
number_suffix:
kilo_text: K
Expand All @@ -505,7 +509,7 @@ core:
content:
javascript_disabled_message: This site is best viewed in a modern browser with JavaScript enabled.
load_error_message: Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.
loading_text: Loading...
loading_text: => core.ref.loading

# Translations in this namespace are displayed in the basic HTML discussion view.
discussion:
Expand Down Expand Up @@ -624,6 +628,7 @@ core:
icon: Icon
icon_text: "Enter the name of any <a>FontAwesome</a> icon class, <em>including</em> the <code>fas fa-</code> prefix."
load_more: Load More
loading: Loading...
log_in: Log In
log_out: Log Out
mark_all_as_read: Mark All as Read
Expand Down