I am having an issue where I cannot retrieve a specific translation from my i18n doctrine objects. If I call $object->getName();
I get the name in the current culture as expected. However, if I wish to retrieve a specific translation without switching the user culture... $object->getName('fr');
I still get the current culture instead of French in this example. This $object->getTranslation()->fr->name;
does work though. What am I doing wrong? Isn't $object->getName($culture);
the correct way to do this?
Here is the relevant part of my schema if that's helpful:
Object:
actAs:
Timestampable: ~
I18n:
fields: [name, description]
columns:
name: { type: string(255), notnull: true }
description: { type: string(1000) }
user_id: { type: integer }
relations:
User: { class: sfGuardUser, local: user_id, foreign: id, type: one, foreignType: many, foreignAlias: Objects }
This almost the same problem as on your other question, use:
I quote the comment I post on the other question:
By the way, I didn't remember that we can use this
$object->getName('fr');
with sf1.0.alternatively: