Charles
Charles

Reputation: 11796

symfony translation in Mysql

I would like to configure Symfony to get Translation from Mysql and not from XLIFF files.

I see explaination on this page : http://www.symfony-project.org/reference/1_4/en/05-Factories#chapter_05_i18n

I configure the factories.yml:

  i18n:
    class: sfI18N
    param:
      source: MySQL

And I get this error: 500 | Internal Server Error | sfException Error in connecting to Array.

I think I should configure which database but I don't know how to do it with doctrine.

Can anyone help me ? :)

Thanks.

Upvotes: 3

Views: 1355

Answers (1)

Aston
Aston

Reputation: 3712

It is described here:

http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and-L10n

jump to section "Text Information in the Database".

Quick description:

  1. create your table like "tablename"
  2. create the translation table "tablename_i18n" like:
    • id
    • culture
    • name ( <= this is what you want to translate)

Now generate the model and it will automatically generate the getName() method against the Tablename object, but it's gonna have a parameter the culture.

Upvotes: 3

Related Questions