Hello,

I met the same problem with symfony 1.4

I think there's a symfony bug.

However i hacked the class sfDoctrineRecordI18Filter : add of one
line :


    $culture = substr($culture, 0, 2);


It works.


I'll be interested of knowing if this will help.

Link : 
http://www.developpez.net/forums/d1008846/php/bibliotheques-frameworks/symfony/orm/i18n-culture/

Christophe (captainiglo)


  public function filterGet(Doctrine_Record $record, $name)
  {
    $culture = sfDoctrineRecord::getDefaultCulture();
    //* ajout CT pour ne récupérer que la langue
    $culture = substr($culture, 0, 2);

    if (isset($record['Translation'][$culture]))
    {
      return $record['Translation'][$culture][$name];
    }
    else
    {
      $defaultCulture = sfConfig::get('sf_default_culture');
      return $record['Translation'][$defaultCulture][$name];
    }
  }


On Feb 18, 6:49 pm, Paolo Niccolò Giubelli
<paoloniccolo.giube...@gmail.com> wrote:
> Thank you for your answer, I already did it, but it still doesn't work :(
>
> -----Messaggio originale-----
> Da: symfony-users@googlegroups.com [mailto:symfony-users@googlegroups.com] 
> Per conto di Roman Gnatyuk
> Inviato: venerdì 18 febbraio 2011 15.28
> A: Symfony users
> Oggetto: [symfony-users] Re: Relationships and i18n
>
> Try in your form class embedd I18n forms:
>
> ...
>  $this->embedI18n(array('ru', 'uk'));
> ...
> And check that "i18n: true" is set in settings.yml of your backend application
>
> On 17 фев, 19:43, Paolo Niccolò Giubelli <paoloniccolo.giube...@gmail.com> 
> wrote:
>
>
>
> > Hi!
>
> > I have the following schema:
>
> > Category:
>
> >   actAs:
>
> >     Timestampable: ~
>
> >     I18n:
>
> >       fields: [name]
>
> >   columns:
>
> >     name:
>
> >       type: string(255)
>
> >   relations:
>
> >     Category:
>
> >       class: Category
>
> >       local: parent_id
>
> >       foreign: child_id
>
> >       refClass: CategoryReference
>
> >       foreignAlias: Parent
>
> >     Products:
>
> >       type: many
>
> >       class: Product
>
> >       local: id
>
> >       foreign: category_id
>
> > CategoryReference:
>
> >   columns:
>
> >     parent_id:
>
> >       type: integer
>
> >       primary: true
>
> >     child_id:
>
> >       type: integer
>
> >       primary: true
>
> > As you can see, Category has a relation with itself, so to create a
> > category tree.
>
> > Everything works fine until I try to edit a category using
> > admin-generated forms, as it says:
>
> > SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c.name' in
> > 'field list'
>
> > It tries to retrieve “name” field from “category” table instead of
> > “category_translation”… why? :-| Is this a bug?
>
> > I spent a lot of time trying to find a solution, but I didn’t succeeded.
>
> > I used this schema in other projects, without i18n, and it works flawlessy.
>
> > I’m using symfony 1.4.9 (this happens also on 1.4.8).
>
> > Thank you in advance!
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google Groups 
> "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com To 
> unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to