I have never done anything like this before, so this is just a stab in the dark...
Have some PHP like this in the page header:
- <?php echo '<script type="text/javascript"> var language = ' . $language . ';</script>';
And then you can have a JS language file like this:
- var text = new Array();
- // Hello
- text['hello']['en-us'] = 'Hello';
- text['hello']['es-mx'] = 'Holla';
And then you can use this like so:
- alert(text['hello'][language]);
Again, I have no idea if this is the best way to do this. But it seems like it could work.
--------------------------------------------------
Victor Michnowicz
http://www.vmichnowicz.com