开发者

symfony translation in Mysql

开发者 https://www.devze.com 2023-02-20 03:27 出处:网络
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_i18

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 do开发者_如何学编程ctrine.

Can anyone help me ? :)

Thanks.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消