The dir attribute needs to be set even when the language file is preloaded and registered
Code extracted to a function.
Removed unused variable, fixed docs listing.
Changelog entry.
Merge branch 't/11911'