Forums / Developer / please bring back ezi18n

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