0
votes

Sonata Amin bundle
Translation works correctly (in thw whole) - takes translations from messages.ru.yaml.
BUT
It tries to translate not only labels, but also data values loaded from DB.
For example, I have bouquets and their category.
Bouquet categiries kept in DB table and when I edit bouquet, I can choose category in select/option built by Sonata Admin from table data.
And translator tries to translate all values of bouquet categoty (in select/options) taken from DB
Not labels - VALUES!
In the console
php bin/console debug:translation ru --only-missing
I cant see them in list
But I can see them in Missing Messages in Sonata Admin page (/_profiler/956513?panel=translation)
How to make translation not to take theese values and translate labels only?
ru messages 1 no description (id: 1) no description (id: 1)
ru messages 1 no description (id: 2) no description (id: 2)

1

1 Answers

0
votes

Problem is solved by param 'choice_translation_domain' => false,

            ->add('category', ModelType::class, [
                'choice_translation_domain' => false,
                'class' => FlowerCategory::class
            ])