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

Accessibility calendar switch buttons #11661

Merged
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
20 changes: 20 additions & 0 deletions dojo/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -4964,3 +4964,23 @@ msgstr ""
#: dojo/utils.py
msgid "Home"
msgstr ""

#: dojo/templates/dojo/calendar.html
msgid "Previous month"
msgstr ""

#: dojo/templates/dojo/calendar.html
msgid "Next month"
msgstr ""

#: dojo/templates/dojo/calendar.html
msgid "Month preview"
msgstr ""

#: dojo/templates/dojo/calendar.html
msgid "Week preview"
msgstr ""

#: dojo/templates/dojo/calendar.html
msgid "Day preview"
msgstr ""
11 changes: 10 additions & 1 deletion dojo/templates/dojo/calendar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}

{% block content %}
{{ block.super }}
Expand Down Expand Up @@ -75,7 +76,15 @@
},
{% endfor %}
{% endif %}
]
],
viewRender: function(view, element) {
// Updating aria-label attributes calendar switches after the view is rendered
$('.fc-prev-button').attr('aria-label', '{% trans "Previous month" %}');
$('.fc-next-button').attr('aria-label', '{% trans "Next month" %}');
$('.fc-month-button').attr('aria-label', '{% trans "Month preview" %}');
$('.fc-basicWeek-button').attr('aria-label', '{% trans "Week preview" %}');
$('.fc-basicDay-button').attr('aria-label', '{% trans "Day preview" %}');
}
});
});
</script>
Expand Down
Loading