From 6a62e3d0853c0e3ef78623d5f071cde580be42af Mon Sep 17 00:00:00 2001 From: ebraminio Date: Thu, 17 Nov 2022 04:52:10 +0330 Subject: [PATCH] i18n: Make captions autodetect text direction (#2540) This uses browser mechanism for detecting appropiate direction for text, dir=auto. --- src/js/captions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/captions.js b/src/js/captions.js index 856baccf..c22a1ddb 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -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); }