Skip to content

Commit

Permalink
Merge branch 'version/automated'
Browse files Browse the repository at this point in the history
  • Loading branch information
daun committed Apr 15, 2024
2 parents 1f1ceb8 + 4d28dd7 commit bbff8d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [4.5.2] - 2024-04-15

- Use fallback announcement for unknown languages

## [4.5.1] - 2024-04-02

- Fix the type signature of `AnnouncementTranslations`
Expand Down Expand Up @@ -54,6 +58,7 @@

- Initial release

[4.5.2]: https://github.com/swup/a11y-plugin/releases/tag/4.5.2
[4.5.1]: https://github.com/swup/a11y-plugin/releases/tag/4.5.1
[4.5.0]: https://github.com/swup/a11y-plugin/releases/tag/4.5.0
[4.4.2]: https://github.com/swup/a11y-plugin/releases/tag/4.4.2
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@swup/a11y-plugin",
"amdName": "SwupA11yPlugin",
"version": "4.5.1",
"version": "4.5.2",
"description": "A swup plugin for enhanced accessibility",
"type": "module",
"source": "src/index.ts",
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export default class SwupA11yPlugin extends Plugin {
const lang = document.documentElement.lang || '*';

const templates: Announcements =
(announcements as AnnouncementTranslations)[lang] || announcements;
(announcements as AnnouncementTranslations)[lang] ||
(announcements as AnnouncementTranslations)['*'] ||
announcements;
if (typeof templates !== 'object') return;

// Look for first heading in content container
Expand Down

0 comments on commit bbff8d8

Please sign in to comment.