How to give language strings in js while using cakephp (Im using cakephp version 2) ? I know, this can be done in the following way.
<script>
var LABEL_LOGIN = '<?php echo __('Login'); ?>';
</script>
I want to separate my js code from my view file. Anything wrong if I do the same in .js file (because I am using global vars) ? Is there any other good solution to apply multilanguage in js ?
Cake does not support i18n in JS out of the box. I would rather recommend pulling in some i18n JS plugin which is syntactically compatible, i.e. also uses a global __ function.
Then you coul use the same method to parse all source codes for i18n keys.