I have a javascript code that needs localisation, ie.
function js_proc() {
var some_data = \'this text needs to be translated dynamically at runtime\';
}
I'm not quite sure what you mean by "There are way too many js strings to be translated, so I can't pass every string as a variable", but if you are looking for some automatic parsing, this won't help.
But this may help others, so here goes.
For from ideal, I use a system like the following:
In my view, I add the localizations as JavaScript global variables, using the codeigniter languages support. Something like:
Then after that, usually,right after, I include the scripts that refernce the globals:
inside the script:
alert(noEmailError);
will show the localized text just fine.