Thanks for updating the example, I have a question before I update the README.
How do I set the primary locale in a table that has multiple languages?
#[Polyglot\Locale(primary: "en_GB")]
#[ORM\Entity(repositoryClass: DocumentRepository::class)]
class Document
but suppose each document has it's own locale field? My fixtures now look like
$document = (new Document())
->setPrimaryLocale('en')
->setText('hello, world');
$document->getText()->setTranslation('hola, mundo', 'es');
$manager->persist($document);
$document = (new Document())
->setPrimaryLocale('es')
->setText('adios');
$document->getText()->setTranslation('good-bye', 'en');
$manager->persist($document);
How do I map the primary locale? When I use it the attribute on the property, I get
Class App\Entity\Document uses translations, so it needs to provide the primary locale with the Webfactory\Bundle\PolyglotBundle\Attribute\Locale attribute at the class l
evel. This can either be at the class itself, or in one of its parent classes.
That is, I don't want to set the primary locale on the entire table, but rather on a specific field.
Thanks for updating the example, I have a question before I update the README.
How do I set the primary locale in a table that has multiple languages?
but suppose each document has it's own locale field? My fixtures now look like
How do I map the primary locale? When I use it the attribute on the property, I get
That is, I don't want to set the primary locale on the entire table, but rather on a specific field.