Sa11y 5.0.6
Improved i18n support
All language files have been refactored to organize strings into distinct categories: ui, tooltip, and rulesets. This architectural update allows developers to programmatically import ruleset strings from other languages, drastically improving the accuracy of localized validation. This change is 100% backwards compatible with zero breaking changes.
Example
The example below demonstrates how importing Ukrainian ruleset strings enhances audit accuracy, such as detecting localized stopwords in alt text. While the user interface displays in English, the validation engine will scan for both English and Ukrainian placeholder words.
<link rel="stylesheet" href="../../src/css/sa11y.css" />
<script type="module">
import { Sa11y, Lang } from '../../src/js/sa11y.js';
import Sa11yLangUa from '../../src/lang/ua.js';
import Sa11yLangEn from '../../src/lang/en.js';
// Instantiate
const mergedStrings = { ...(Sa11yLangEn.strings), ...(Sa11yLangUa.ruleset) };
Lang.addI18n(mergedStrings);
const sa11y = new Sa11y({});
</script>Acknowledgements
Many thanks to @itmaybejj and @brianteeman (#162).