If mw.loader.getState( 'mediawiki.jqueryMsg' ) is not 'ready', and I execute the code
mw.messages.set( { 'some-key': 'SomeText {{SomeTemplate}}.' } ); alert( mw.msg( 'some-key' ) );
I get 'SomeText {{SomeTemplate}}.' as expected.
But if I enable any gadget which loads the module 'mediawiki.jqueryMsg', and run the same code again, the result unexpectedly changes to 'some-key: Unknown operation "sometemplate"'.
It should still be 'SomeText {{SomeTemplate}}.', because there is no magic word called 'SomeTemplate'