Need just a push in the right direction with this.
I'm building a multi-language website in PHP and JavaScript. When using javascript (AJAX) to send comments/messages to the database I need to show a Success or Error message to the user. Because of using 3 different languages, I'm writing the code on each page where I use the code and using PHP language variables to translate the success/error message.
Everything works fine, but when a user looks into the source of the page he will see a long list of functions I'm using for different things on the website.
I would like to include everything in a JS file:
But then the PHP language variables wouldn't work.
The only thing that comes in my mind right now is making different JS files with different languages: myjs_en.js
myjs_fr.js
myjs_nl.js
And checking which language the user has chosen, including one of the 3 files.
Or is there some other option I can use for this?
Thanks for the help!