Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
I18n not creating record property / related component "Translation"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Mark Wright  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 11:10
From: Mark Wright <sparkymeis...@gmail.com>
Date: Sun, 8 Nov 2009 04:10:01 -0700
Local: Sun 8 Nov 2009 11:10
Subject: I18n not creating record property / related component "Translation"
So I create a model that acts as I18n. I do it just as the docs say.
Then when I try to add something with
$record['Translation']['language']['column'] = 'value'; I get the
following exception:

Doctrine_Record_UnknownPropertyException: Unknown record property /
related component "Translation" on "Simple"

I also got another exception when creating the tables in
Doctrine/Record/Generator.php:159 because class_exists() was trying to
autoload a class that didn't exist. That class was the translation
class. I got rid of that by adding false as the second argument to
class_exists() but perhaps that was a sign of a deeper problem. It
does correctly create the db tables, but only when I add false as the
second argument to class_exists() or remove the act asi18n you see
below.

Here is how I create the translation:

$this->actAs('I18n', array(
                                'length'        => 5,
                                'fields'        => array(
                                                                        'price',
                                                                        'type',
                                                                        'name',
                                                                        'description',
                                                                        'shortDescription',
                                                                        'featured',
                                                                        'metaDescription',
                                                                        'metaKeywords',
                                                                        'active',
                                                                        'featured',
                                                                        'visible'
                                                                ),
                        )
                );

And I would set it like this:
$productObj['Translation']['en_US']['price'] = 29.99;

If it makes any difference I am running the
Doctrine_Core::createTablesFromModels() method from my test case, not
the cli. And I am using version 1.2.

Mark

--
Have fun or die trying - but try not to actually die.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google