How should I add multi language support to my web app across PHP, JS and Template Files?
- by Camsoft
I'm building a website that needs to support different language translations. I have strings in PHP, JavaScript and Smarty Template files that need to translated.
I want to use something like PHP's gettext() function and have a single language file for each locale.
This is easy when the translatable strings are in the PHP files but I also have text in the Smarty Templates and JavaScript files that also need to be translated.
I really want one single file that holds all the translatable strings.
What is the best way to achieve this?