Skip to content
Snippets Groups Projects
Verified Commit ab8f13a5 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: Add i18n support in CustomElement template formatting

Summary of changes
- Enhanced `CustomElement` class with i18n property for template formatting. The property is initialized to false and can be enabled for internationalization support.
- Implemented `substituteI18n` function to handle i18n formatting for HTML content using a `Formatter` instance, which applies labels to the templates.
- Updated the `initHtmlContent` and `initShadowRoot` methods to call `substituteI18n`, thereby applying i18n formatting when rendering HTML.

- Updated the import sequence in the JSDOM tests to ensure consistent element polyfills are loaded before tests run.
- Added debug logging for key setting in the JSDOM initialization to assist in debugging any issues with key assignments from the `window` object.

These changes allow developers to specify an i18n option when using the `CustomElement`, enhancing localization capabilities for template rendering. The adjustments in the tests enhance reliability and traceability during the testing process.
parent a7eb9d7e
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment