Prezent / doctrine-translatable

Translatable behaviour extension for Doctrine2
MIT License
26 stars 17 forks source link

Somehow proxy setters and getters and abstract translate() method #28

Closed cv21 closed 8 years ago

cv21 commented 8 years ago

I think, it is possible, to use translate() method out of the box.

https://github.com/Prezent/doctrine-translatable/blob/master/doc/getting-started.md#proxy-getters-and-setters

sandermarechal commented 8 years ago

What is your question exactly?

You can use that translate() method if you want. Copy it, change it, put it in a base class, it's all good. This library does not add a default translate() method though. What happens inside the translate() method depends very much on your own business domain.

What happens when a translation does not exist yet? That depends on your application. Maybe you want to show an error. Maybe you want to create an empty translation. Maybe you want to fall back to a different language. Maybe you want to call the Google Translate API and translate it on the fly! We cannot account for all these possibilities, so you have to build your own translate() method.