fetch template on cronjob in a specific language ..

Author Message

Nicolas DENIS

Thursday 25 August 2011 8:08:22 am

Hello All,

I have a problem to fetch a template in a specific language on my cronjob.

 

The situation is:

A cronjob should generate template content in a specific language for each query.

The cron is launched in the admin siteaccess(‘-sadmin’ option). So specifying another siteaccess in the command line is not an option.

This task is used by several eZ Publish install going from 4.2 to 4.3.

 

I tried to generate my template like this:

$language_code=’fre-FR’;

$tpl = templateInit();

$mytemplate = $tpl->fetch( ‘design:templatetogeneratewithI18n.tpl’ , array( ‘locale_code’ => $language_code ) );

 

But it didn’t work.

Is it possible to specify a language in fetch()? Or can I change the siteaccess at runtime?

Thanks!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.