views:

98

answers:

1

I'm using symfony and propel, and I'm trying to invoke a specific culture on an object and output some fields of that object to the screen in that specific culture. However, if the object's mapped database record doesn't have those fields in that specific culture, I would like it to default to the base culture (in this case, en_US)

I'm doing it like this:

$currentLesson = $currentLesson->getCurrentLessonsI18n($lessonCulture);

But when I output such as this

$currentLesson->getTitle();

It outputs an empty string if there is no culture record for it. My question is, is there a way to make an object default to a specific culuture if the one I specify isn't available, or is there a method to see if a specific object has a culture i18n record?

something like this:

if($currentLesson->cultureExists($lessonCulture) $currentLesson = $currentLesson->getCurrentLessonsI18n($lessonCulture);

or

sfConfig::setPropelDefaultCulture("en_US");

Thanks for the help.

+1  A: 

You will have to overwrite symfony itself to make it default to another language. Theres a good working solution here http://www.codemassacre.com/tag/symfony-i18n-propel/

Marek