i18n: Make captions autodetect text direction (#2540)

This uses browser mechanism for detecting appropiate direction for text, dir=auto.
This commit is contained in:
ebraminio 2022-11-17 04:52:10 +03:30 committed by GitHub
parent aba00d0ab6
commit 6a62e3d085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,7 @@ const captions = {
// Inject the container
if (!is.element(this.elements.captions)) {
this.elements.captions = createElement('div', getAttributesFromSelector(this.config.selectors.captions));
this.elements.captions.setAttribute('dir', 'auto');
insertAfter(this.elements.captions, this.elements.wrapper);
}