开发者

Symfony: i18n in generator.yml

开发者 https://www.devze.com 2023-02-01 15:00 出处:网络
Does anyone know if there\'s a possibility to use i18n in the generator.yml file l开发者_如何学Goike this:

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

精彩评论

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