2

I have in my template something like that

<h1>Workers {{ 'views.index.list'|trans({}, 'JordiLlonchCrudGeneratorBundle') }}</h1>

And I want to translate this but I don't know how. I guess have to create a file with translations but where save it ,how name a file and what write inside? In app/config/config.yml I have 'translator: { fallback: "%locale%" }'

In 'symfony/app/config/parameters.yml' defined locale parameter "locale:pl"

konadrian
  • 587
  • 2
  • 9
  • 26

1 Answers1

0

First look at the bundle's Resources / translations folder. It looks loke this:

JordiLlonchCrudGeneratorBundle.ca.yml
JordiLlonchCrudGeneratorBundle.en.yml
JordiLlonchCrudGeneratorBundle.es.yml

Then create a file JordiLlonchCrudGeneratorBundle.pl.yml (if you want to translate to the pl local) and put it to the app/Resources/JordiLlonchCrudGeneratorBundle/translations directory.

Use one of the default translation files as a pattern for your translation, translate all text you need and save it to the pl translation file you've just created.

See also: http://symfony.com/doc/2.1/cookbook/bundles/inheritance.html#overriding-resources-templates-routing-validation-etc

ozahorulia
  • 9,798
  • 8
  • 48
  • 72