This should be [`->plain()`](https://github.com/wikimedia/mediawiki-core/blob/master/includes/MessageBlobStore.php#L372) not `->text()`. The reason is `->text()` tries to transform the message (i.e. convert `{{PLURAL:}}` and `{{GENDER:}}`), which can't be done in advance of using the message with parameters. `->plain()` leaves things like `{{GENDER:$1|his|her|their}}` in place in the stored blob, so then mediawiki.language.js can convert that to the correct usage based on the gender of the user viewing the page. Likewise for `{{PLURAL:}}` with numbers.