-
Notifications
You must be signed in to change notification settings - Fork 3
Translate annotations
BowlOfSoup edited this page Sep 16, 2020
·
2 revisions
By default, the translation must be in a Resources/translations/messages.en.xliff. You can specify a custom domain (xliff file)
/**
* @Bos\Normalize(group={"somegroup"}, name="automobile")
* @Bos\Translate(group={"translation"}, domain="some_domain")
*/
private $propertyToBeNormalized
This tries to find the translation in Resources/translations/some_domain.en.xliff.
You can specify your locale, if you did not set that globally in Symfony.
/**
* @Bos\Normalize(group={"somegroup"}, name="automobile")
* @Bos\Translate(group={"translation"}, domain="some_domain", locale="nl")
*/
private $propertyToBeNormalized
This will search for the translation in Resources/translations/some_domain.nl.xliff, notice the nl in the file name (Dutch language).