diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8b3c6..50c70da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` @@ -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 diff --git a/package-lock.json b/package-lock.json index 626924e..23f7aee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@swup/a11y-plugin", - "version": "4.5.1", + "version": "4.5.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@swup/a11y-plugin", - "version": "4.5.1", + "version": "4.5.2", "license": "MIT", "dependencies": { "@swup/plugin": "^4.0.0", diff --git a/package.json b/package.json index 99ebc18..34ff557 100755 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 7576a26..a58dfae 100755 --- a/src/index.ts +++ b/src/index.ts @@ -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