Answer the question
In order to leave comments, you need to log in
How to organize the logic of translating texts from the database, which depends on the request and the filling of the fields?
There is a reference book, which is the essence of Doctrine.
The reference book stores translations of the name into different languages in columns.
The user can see the content in the default language for his country, and if the content in this language is not filled in, then the text in the base language is displayed (there are several base languages, each country has its own).
Actually the question is: where to put this translation selection logic, given that there are quite a lot of reference books.
Bonus track - how to teach forms to choose a translation according to the same principle? As far as I understand, query_builder for the entity type is not suitable here? You need to make your own type, inherit it from choice and manually collect choices in buildForm? Or is there some better way? Again, there are a lot of directories, I would not want to duplicate the logic in each type.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question