-
Type:
Bug
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: InstantTranslate
-
Critical
-
None
-
InstantTranslate: Fixed checking if file translation is fully pretranslated and can be downloaded
-
None
-
Emptyshow more show less
The problem
There is a bug in calculation if task was pretranslated which causes a warning message and not downloadable tasks in InstantTranslate however tasks are pretranslated properly.
For details see linked TS issue
Dev info
Code reference is application/modules/editor/PrivatePlugins/InstantTranslate/FileTranslationDownloads.php:287
it expects array of shape ['%autoStateId%' => '%countOfSegments%']
but receives array of shape ['%index%' => ['autoStateId' => '%autoStateId%', 'cnt' => '%countOfSegments%']]
So in case amount of autostates in the task is > 3 - error message is shown and task is not downloadable in the InstantTranslate
Solution
Fix the bug
Also need to change the error message to: The file could not be fully translated, most likely because an external automatic translation source was not working properly. Please notify the administrator.
Testing:
This can not be normally tested without accessing the codebase and database, thus needs to be tested by a developer
- Create a file translation task in instant translate and check that no warning is written to the log and file can be downloaded
- add 'return false;' at the beginning here \MittagQI\Translate5\Plugins\InstantTranslate\Service\FilePretranslationChecker::taskIsFullyPretranslated
- Create a task again and check task event log for the warning message 'The file could not be fully translated ...'
- Check task can not be downloaded in instant translate with the message 'The file could not be fully translated ...'
- relates to
-
TRANSLATE-5711 InstantTranslate: show the user when a pre-translated file contains untranslated segments
- Groom review