Welcome Guest, Not a member yet? Register   Sign In
localisationin .js files?
#3

[eluser]Bramme[/eluser]
Thanks for the suggestion. I posted this question on Forrst too, somebody there gave me a good idea:"Put the strings in a JSON file? Readable by both JS and PHP." Which would actually work nice.

I use another way at the moment, that works pretty well for me too: I made a js controller that outputs a javascript/application header, in the controller methods I simply echo the javascript I need in json objects. This way, I created two objects: lang and config, which lets me use things like base_url() etc too.

If anyone's interested, I can post some more code.


Messages In This Thread
localisationin .js files? - by El Forum - 06-15-2011, 09:24 AM
localisationin .js files? - by El Forum - 06-16-2011, 04:47 AM
localisationin .js files? - by El Forum - 06-16-2011, 04:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB