Register now or log in to join your professional community.
A translation strategy needs to be selected by adding the translator parameter to the document mapping. The translation strategy is responsible to actually persist the translated properties.
There are two default translation strategies implemented and automatically available:
Thus, if you do not have many fields, the attribute strategy puts less load on the content repository. On the other hand, if you have a lot of fields on your document, you may want to use the child strategy.
If needed, it is possible to implement other strategies to persist the translations.
You may want to implement your own translation strategy to persist the translatable properties of a node. For example if you want all the translations to be stored in a separate subtree of you content repository.
To do so you need to implement the Doctrine\\ODM\\PHPCR\\Translation\\TranslationStrategy\\TranslationStrategyInterface.
Then you have to register your translation strategy with the document manager during the bootstrap.
If I'm in a hurry I'll use Google Translate if it is not in English in order to get the overall meaning. If it is more specialised, I will reach out to my wider network since there is usually someone who can assist me.
Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.