开发者

Symfony: i18n in generator.yml

Does anyone know if there's a possibility to use i18n in the generator.yml file l开发者_如何学Goike this:

generator:
  class: sfDoctrineGenerator
  param:
    ...
    config:
      edit:
        title: Editing Category xyz

Now I'd like to translate the title in my i18n files.


It should work out of the box. All the form labels are passed through translation function automatically.

You need to enable i18n in your application and create translation files. Simple as that.

Assuming you have a backend application, to enable i18n edit your apps/backend/settings.yml:

all:
  .settings:
    i18n: true

Generate translation catalog for language(s) you need:

./symfony i18n:extract --auto-save backend fr

At the end you need to translate your messages. Simply edit generated apps/backend/i18n/fr/messages.xml.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜