With TraductionPHP, you can translate text based on messageformat.js templating in PHP