One of my biggest issues is implementing language options for javascript. So far, I've managed to have a language file load whenever a cookie is detected for that language. Although everything works fine on the PHP side, the javacript portion of the site is still in English; alerts and custom function etc. What I should do, is like I did with the PHP side of things: create a language file with custom strings:
//EN file
$lang["TEST"] = " You have % order(s) waiting in your queue ";
//FR file
$lang["TEST"] = " Vous avez %s commande(s) dans votre file d'attente ";
What's great about this, is I can use sprintf($lang["TEST"], 4);
at will on every page.
What would be great, however, is to be able to store such strings in a js file that can be formatted the same way depending on what the functions wants to output.
How can I achieve this?