-
- Downloads
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.
Loading
Please register or sign in to comment