updated for new translations
Rewrite of template generator in PHP