Cronjobs, mail and i18n

Author Message

Maxime Thomas

Friday 05 January 2007 1:51:01 am

Hi,

I'm working with ez 3.8.6, multi language site.

I've made a cronjob which must send emails to some users.

For each user, I can have have is language (it's an attribute I've had to the class).

But, in the cronjob, I've no idea of what is the current language (en, fr, es) and even if I could know this, how can I specify to the PHP function ezi18n() what is the translation I want.

<b>So, how could I make a correct translation using i18n feature of eZ publish into a cronjob ?</b>

If any one has an idea...

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Maxime Thomas

Thursday 11 January 2007 3:02:32 am

I've got a solution :

When I run the cronjob I can put a siteaccess parameter in the line command, so I can use the ezi18n() function properly with the locale declared in the site.ini of the correct siteaccess.

But I was wondering if I can explicitly get a specific translation for a given language using a ezi18n like...

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

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

eZ debug

Timing: Jan 18 2025 19:17:02
Script start
Timing: Jan 18 2025 19:17:02
Module start 'layout'
Timing: Jan 18 2025 19:17:02
Module start 'content'
Timing: Jan 18 2025 19:17:02
Module end 'content'
Timing: Jan 18 2025 19:17:02
Script end

Main resources:

Total runtime0.6805 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0101 588.9219152.6094
Module start 'layout' 0.01020.0043 741.531339.4141
Module start 'content' 0.01450.6645 780.9453490.4609
Module end 'content' 0.67900.0015 1,271.406312.1875
Script end 0.6804  1,283.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5766160.0002
Check MTime0.00130.1958160.0001
Mysql Total
Database connection0.00190.273610.0019
Mysqli_queries0.625391.8971520.0120
Looping result0.00050.0797500.0000
Template Total0.626292.020.3131
Template load0.00230.339820.0012
Template processing0.623891.679520.3119
Template load and register function0.00010.016510.0001
states
state_id_array0.00240.356210.0024
state_identifier_array0.00240.348920.0012
Override
Cache load0.00190.2757160.0001
Sytem overhead
Fetch class attribute can translate value0.00080.113010.0008
Fetch class attribute name0.00200.290730.0007
XML
Image XML parsing0.00050.072610.0005
class_abstraction
Instantiating content class attribute0.00000.001540.0000
General
dbfile0.00090.1261160.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs