umpirsky wrote: > > Hi. > > I'm thinking about best way to translate js files. > > In my previous project, I use to have server side generated js file for > translation, looked like > > var STR1 = <?= $this->translate('str.') ?>; > var STR2 = <?= $this->translate('str2.') ?>; > // ... > > But is this really required, maybe writing manual this files and then just > include one depending on lang settings, for better performances, but, this > one can be cached also if you mess with headers a bit. > > How do you handle this? > > Regards, > Sasa Stamenkovic. > Hi,
<script type="text/javascript" src="<?php echo $this->baseUrl('myfule-'.$this->lang.'.js'); ?>"></script> but making so you can't exploit <?= $this->translate('str.') ?>; so you have double translation so I think a better way is do a think like this <script type="text/javascript" src="<?php echo $this->baseUrl('myfule-'.$this->lang.'.php'); ?>"></script> with the right header. Bye. -- View this message in context: http://n4.nabble.com/How-do-you-translate-javascript-files-tp1748879p1751159.html Sent from the Zend Framework mailing list archive at Nabble.com.