Attribution check happens post translate, allowing unattributed translations

Description

Performing a MT translation on a (eg.) JSON document allows the document to be translated, but as the attribution is hard-coded to a subset (.po, .properties) and done afterwards, the translations are left as is without attribution.

1 2 (ERROR [org.zanata.async.AsyncTaskManager] (pool-11-thread-3) Exception when executing an asynchronous task.: java.lang.RuntimeException: unexpected DocumentType for HDocument(docId=flatten/slash-in-key.json, name=slash-in-key.json, path=flatten/, revision=1, locale=HLocale(localeId=en-US)) at org.zanata.service.impl.AttributionService.addAttribution(AttributionService.kt:76))

The check should happen before sending the document to MT.

Environment

None

Status

Assignee

Damian Jansen

Reporter

Damian Jansen

Labels

Tested Version/s

None

Components

Fix versions

Affects versions

platform-4.6.0

Priority

High
Configure