Meant "designers". It was built for people who are mainly designers are not developers.
On Nov 10, 1:22 pm, Thiago Belem <cont...@thiagobelem.net> wrote: > I've nothing against MooTools, but why jQuery is a design framework? > > -- > ***Thiago Belem* > Desenvolvedor > Rio de Janeiro - RJ - Brasil > > +55 (21) 8865.9250 > thiagobelem.net > cont...@thiagobelem.net > > *Skype / gTalk **»* thiago.belem.web > *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt* > Assando Sites*, curso de CakePHP *»* assando-sites.com.br > > 2011/11/10 Miles J <mileswjohn...@gmail.com> > > > > > > > > > If you were using MooTools, you could also just use the Locale > > library. > > >http://mootools.net/docs/more/Locale/Locale > > > Really wish people would use Moo more over jQuery. jQuery is a designs > > framework. > > > On Nov 10, 1:40 am, AD7six <andydawso...@gmail.com> wrote: > > > On Nov 9, 7:32 pm, Miles J <mileswjohn...@gmail.com> wrote: > > > > > No there isn't really. This is also a problem for any language, and > > > > unless you have back-end parsed JS files it's not possible. The only > > > > solution is so place a JS literal object in your page source > > > > containing the message strings: > > > > > <script> > > > > var Msg = { > > > > username: '<?php echo __('username'); ?>', > > > > someKey: '<?php echo __('moreKeys'); ?>'}; > > > > > </script> > > > > > And then reference it in your JS: > > > > > alert(Msg.username); > > > > OR, the other only solution is, to only don't embed things in your > > > page source. And instead: > > > > 1) use __() in your js files > > > 2) load a js file with that function defined, like this: > >https://github.com/AD7six/mi_js/blob/master/i18n.js > > > 3) Define a js object (i18n in the above js file) with your message > > > definitions in it any way you can/like. > > > > That's basically it, and you'll see the same not-only technique used > > > with, for example, the jquery date picker - see how it works if you > > > don't understand the above explanation. > > > > The simplest cakephp way to generate those i18n js objects is similar > > > to what Miles suggested: create a controller and route /js/i18n.xx.js > > > to it. and define a view which returns valid js like this: > > > > i18n = { > > > 'foo' => '<?php __d('javascript', 'foo'); ?>', > > > .. > > > > }; > > > > Then you don't need to do anything special to be able to generate your > > > po files and use translations in your js files. You only need to > > > request /js/i18n.xx.js to change the language of things that come out > > > of your js files. If you want to parse out the __() calls from your js > > > files - that's not hard either, some reference (but if you don't > > > understand - just do the above): > > >https://github.com/AD7six/mi_development/blob/master/vendors/shells/t... > > > > AD > > > -- > > Our newest site for the community: CakePHP Video Tutorials > >http://tv.cakephp.org > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help > > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php