Loading Trix javascript after `trix-editor` is in the DOM: Setting `Trix.config.lang` does not set custom text in toolbar
- Dominant language
- JavaScript
- Stars
- 20k
- Forks
- 1.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 13
Description
**Expected**: Toolbar texts are set according to those specified in `Trix.config.lang`
**Actual**:

We are running `trix/dist/trix.js` AFTER the `trix-editor` is already in the DOM.
Using Rails 6.0 and Webpacker.
##### Steps to Reproduce
javascript code, which is loaded asynchronously (not placed in the DOM in a script tag before the `trix-editor` element).
```
import 'trix/dist/trix.css'
import Trix from 'trix/dist/trix.js'
Trix.config.lang = {
bold: 'Gras',
bullets: 'Liste',
byte: 'Octet',
bytes: 'Octets',
captionPlaceholder: 'Ajouter légende…',
code: 'Code',
heading1: 'Titre',
indent: 'Agrandir retrait',
italic: 'Italique',
link: 'Lien',
numbers: 'Liste numérotée',
outdent: 'Réduire retrait',
quote: 'Citation',
redo: 'Rétablir',
remove: 'Supprimer',
strike: 'Barré',
undo: 'Annuler',
unlink: 'Supprimer lien',
url: 'Lien',
urlPlaceholder: 'Saisir adresse URL…',
GB: 'Go',
KB: 'Ko',
MB: 'Mo',
PB: 'Po',
TB: 'To'
}
```
The `trix-editor` element is placed in the DOM via ActionText `rich_text_area`, which is in a server-rendered Rails template.
##### Details
* Trix version: https://github.com/basecamp/trix/commit/520cc50afff2b90120f49038945eb0cb73d82535
* Browser name and version: Chrome 87
* Operating system: macOS 11.1
* Rails version: 6.0.3.4 (with ActiveText)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.