Currently:
var x = mw.message('addedwatchtext', 'X'); x.toString() // "[[:X]]" and its talk page have been added to your [[Special:Watchlist|watchlist]]. x.text() // "[[:X]]" and its talk page have been added to your [[Special:Watchlist|watchlist]]. x.escaped() // "[[:X]]" and its talk page have been added to your [[Special:Watchlist|watchlist]]. x.toString() // "[[:X]]" and its talk page have been added to your [[Special:Watchlist|watchlist]].
var x = mw.message('echo-badge-count', 42); x.toString() // "42" x.text() // "42" x.plain() // "{{PLURAL:42|42|100={{formatnum:99}} }}" x.toString() // "{{PLURAL:42|42|100={{formatnum:99}} }}"
We're recently finished removal of the same mess in wfMessage/Message.php: