Hey, this actually works! It's pretty cool because I store the preferred user language for the app in a database-field for the user and now I can send everyone a report email with a cronjob and everyone gets the email in the preferred language! Now I only need to check if I have all the variables I set in the app_controller globally for the whole app accessible in the cron email, that would also be very very nice!
THX to you guys, that one works like a charm :) Regards, DD On 17 Feb., 23:45, Ryan Schmidt <[email protected]> wrote: > Right, you: > > Configure::write('Config.language', 'whatever'); > > Your current code uses the session in some way when deciding what language to > write? Fine for when your code is running as a web site where there is a > session, but for cases when you're running without a session, like in a shell > script, you'll want to have a different method for selecting what language to > write into the config. > > On Feb 17, 2011, at 15:21, John Andersen wrote: > > > Use the Configure statement as specified in the CakePHP book at: > >http://book.cakephp.org/#!/view/1230/Localization-in-CakePHP > > > Enjoy, > > John > > > On Feb 17, 6:44 pm, DigitalDude <[email protected]> wrote: > >> Hey, > > >> I ran into a problem the other day, and I don't know what to do right > >> now. > > >> I have a shell which is run as a cronjob, and this shell/cronjob sends > >> weekly status reports about a users work-environment. In these emails, > >> there is text as gettext and sometimes even i18n models with specific > >> language-depending content. > > >> My problem is: How can I set a Session Language or a locale for the > >> content? In a shell I don't have a Session and I've never seen > >> anything like this before. So does anyone have a clue what's best > >> practice for this kind of stuff? -- 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 [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
