XF 2.2 Edit content just before saving it to database

ininges

Member
Hi,

I want to create an add-on that translate the content automatically from input language to target one (xenforo language, for example: english) . The add-on must take content, make one - or several calls to google translate and use the translated response as post content to be saved.

This is very usefull for people with auto translate plugins that show forums in different languages or gtranslate.io clients.

where do I have to take a look? is there any hook for pre-save content?

kind regards.
 
Yes, there is a code event for that. You might want to take a look at code event listeners. You can also extend the related entity class's _preSave() method but you should use code event listeners as much as possible.
 
Back
Top Bottom