BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

New event after deepL translation #89

Closed ascheider closed 12 months ago

ascheider commented 1 year ago

@BlackbitDevs Hello,

i need a new event after the field is translated via deepL to mark it for some review process. It can be integrated after log entry "Translation result for field" in Importer.php image Can you please integrate it in this way? Thanks! I tried to push it to the repository in a separate branch and create a pull request, but it seems the bitbucket account is read only?

BlackbitDevs commented 1 year ago

I recently added a before data query selector helper for this use-case. It is supposed to work this way:

  1. Text gets translated via DeepL in Dataport 1
  2. Dataport 2 with source type Pimcore objects gets automatically executed when an object of the class changes. It fetches id, description and before:description as raw data fields. before:description will fetch the content of the field description in the previous version. This way you can compare both values in the attribute mapping and set the review checkbox accordingly.

Is available in 3.4.x-dev. Would this suffice your requirements?

PS: Bitbucket access is read-only by default. I will give you write permissions.

ascheider commented 1 year ago

@BlackbitDevs Thank you, write permission works fine 👍 I'm not sure if i correctly understood the logic of the before selector. Do you have some examples how to setup this? Do the customer need to adjust dataport 2 if he changes mapping in dataport 1 and wants to translate some new field? What happens when field changes without translation api, is dataport 2 also executed? I think the event on this point simplifies so much the logic and i do not need to create additional dataports and maintain them.

ascheider commented 12 months ago

@BlackbitDevs We can close the issue. You merged my event already. Thank you!