please bring back ezi18n

Author Message

Georg Franz

Thursday 09 June 2011 2:15:07 am

Hi,

since 4.5, ezi18n is deprecated. So you are getting a fatal error if you are using it.

Well this isn't a problem for the own extensions you are using. But there are still many extensions at projects.ez.no which are not up to date.

My (not optimal) workaround is:

Put this in the config.php:

 /**
 * @deprecated Temporary compatibility layer for extensions
 */
function ezi18n( $context, $source, $comment = null, $arguments = null )
{
    return ezpI18n::tr( $context, $source, $comment, $arguments );
}

/**
 * @deprecated Temporary compatibility layer for extensions
 */
function ezx18n( $extension, $context, $source, $comment = null, $arguments = null )
{
    return ezpI18n::tr( $context, $source, $comment, $arguments );
}

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Jarosław Heba

Thursday 09 June 2011 2:35:37 am

or use: include_once( 'kernel/common/i18n.php' );

 

Kind regards

J.

Georg Franz

Thursday 09 June 2011 2:54:31 am

Hi,

well, I didn't use the include because I am not sure if the file is still there in future versions.

But I took a look in the current file, there is the comment:

/**
 * @deprecated Since 4.3, superseded by {@link ezpI18n::tr()}
 *             Will be kept for compatability in 4.x.
 */

Well, whether the comment is wrong or it's a bug?

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Georg Franz

Thursday 09 June 2011 6:43:31 am

Hi,

include_once( 'kernel/common/i18n.php' );

is the right solution.

If you put the functions in config.php you may get a "cannot redeclare" error from somewhere else.

Thanks Jaroslaw + André for the hint!

Best wishes,
Georg.

--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004

Marko Žmak

Thursday 09 June 2011 11:37:17 am

"

But I took a look in the current file, there is the comment:

/**
 * @deprecated Since 4.3, superseded by {@link ezpI18n::tr()}
 *             Will be kept for compatability in 4.x.
 */

"

Hm does this mean that this file will be removed when eZP 5.x comes out?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

André R.

Friday 10 June 2011 12:59:37 am

Yes, at least most likely.

Btw: There was a comment on this on the doc pages: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Libraries/ezi18n

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Marko Žmak

Friday 10 June 2011 7:43:25 am

"

Yes, at least most likely.

Btw: There was a comment on this on the doc pages: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Libraries/ezi18n

"

So that means that the quickfix Jaroslav suggested (and it's also suggested in the doc comment) will work only until eZP 4.9.

Why keep this file all that time and then remove it?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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 02:54:34
Script start
Timing: Jan 18 2025 02:54:34
Module start 'layout'
Timing: Jan 18 2025 02:54:34
Module start 'content'
Timing: Jan 18 2025 02:54:34
Module end 'content'
Timing: Jan 18 2025 02:54:34
Script end

Main resources:

Total runtime0.0229 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 587.9141152.6250
Module start 'layout' 0.00700.0041 740.539139.4531
Module start 'content' 0.01110.0093 779.992297.9766
Module end 'content' 0.02030.0025 877.968842.2891
Script end 0.0228  920.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003113.6937140.0002
Check MTime0.00125.2462140.0001
Mysql Total
Database connection0.00135.488310.0013
Mysqli_queries0.003515.317230.0012
Looping result0.00000.079310.0000
Template Total0.00208.810.0020
Template load0.00135.506110.0013
Template processing0.00083.304510.0008
Override
Cache load0.00083.663410.0008
General
dbfile0.003214.130880.0004
String conversion0.00000.038640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs