API New JS sprintf and inject replacement functions

Fix sprintf issues when replacement was at start of string + introduce
new inject function using injection map similar to the PHP version of
_t()
Merge pull request #3180 from colymba/i18n-js-injection-fix

API New i18n JS sprintf and inject replacement functions