eZ Community » Forums » Developer » please bring back ezi18n
expandshrink

please bring back ezi18n

please bring back ezi18n

Thursday 09 June 2011 11:15:07 am - 7 replies

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 );
}

Thursday 09 June 2011 11:35:37 am

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

 

Kind regards

J.

Thursday 09 June 2011 11: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?

Thursday 09 June 2011 3:43:31 pm

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!

Modified on Thursday 09 June 2011 3:52:36 pm by Georg Franz

Thursday 09 June 2011 8:37:17 pm

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?

Friday 10 June 2011 9: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/Techn...anual/4.x/Reference/Libraries/ezi18n

Modified on Friday 10 June 2011 1:38:44 pm by André R

Friday 10 June 2011 4:43:25 pm

Yes, at least most likely.

Btw: There was a comment on this on the doc pages: http://doc.ez.no/eZ-Publish/Techn...anual/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?

Tuesday 20 September 2011 3:48:29 pm

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 );
}

I have basically the opposite problem: I'm trying to use an extension that references ezpI18n in an ezp 4.2 environment, in which ezpI18n does not yet exist. We are planning to upgrade soon so this will not be a problem then but meanwhile I'm trying to test this extension today and am looking for a quick fix. Is it easier to hack the extension or hack the 4.2 kernel? (Yes, this is in a staging environment.) 

EDIT: Nevermind, it's done. I just added the ezpi18n class file and then included it where it was needed, problem solved.

Modified on Tuesday 20 September 2011 4:07:56 pm by David Wirth

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from