Create new translation for an object in pure PHP

Create new translation for an object in pure PHP

Wednesday 04 February 2009 8:48:47 am - 2 replies

Modified on Wednesday 04 February 2009 8:50:10 am by Guillaume Marty

Author Message

Guillaume Marty

Friday 13 February 2009 8:15:10 am

Any help? Please!

How to create a new language of an object and save attributes the clean way?

nehal shah

Friday 29 April 2011 5:36:39 am

Hi,

I have the same problem.I want to add translation for the current version of the object through php. Here is my code.

$objectID = 6413;
$object = eZContentObject::fetch( $objectID );
$catalanVersion = $englishObject->createNewVersion( $object->CurrentVersion, true, 'hun-HU', 'eng-GB' );

$contentObjectAttributes = $catalanVersion->contentObjectAttributes();
$contentObjectAttributes[0]->setAttribute( 'data_text', 'Urinary System1');
$contentObjectAttributes[0]->store();
$contentObjectAttributes[1]->setAttribute( 'data_text', '202.59.12');
$contentObjectAttributes[1]->store();

but when i run this code it is showing error.

Please anyone has solution for adding translation through php?

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

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