Re: Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-19 Thread DigitalDude
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

Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-17 Thread DigitalDude
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

Re: Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-17 Thread John Andersen
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 e.blumsten...@googlemail.com wrote: Hey, I ran into a problem the other day, and I don't know what to do right now. I

Re: Shell/CronJob - How to set locale for gettext() and i18n?

2011-02-17 Thread Ryan Schmidt
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