There is an API call for checking the status of the particular translation memory t5memory - translate5 TM service - REST API#GetthestatusofTM
Response from the endpoint looks next:
{ "status": "not found" }
{ "status": "available" }
{ "status": "open", "tmxImportStatus": "available", "importProgress": 100, "importTime": "Overall import time is : 0:00:01\n", "segmentsImported": 1, "invalidSegments": 0, "invalidSymbolErrors": 0, "importErrorMsg": "", "lastAccessTime": "" }
{ "status": "open", "tmxImportStatus": "import", "importProgress": 0, "importTime": "not finished", "segmentsImported": -1, "invalidSegments": -1, "invalidSymbolErrors": -1, "importErrorMsg": "", "lastAccessTime": "" }
{ "status": "open", "tmxImportStatus": "failed", "importProgress": 100, "importTime": "Overall import time is : 0:00:00\n", "segmentsImported": 0, "invalidSegments": 1, "invalidSymbolErrors": 0, "importErrorMsg": "", "lastAccessTime": "", "ErrorMsg": "some error in import process" }
Response parsing
While parsing the response from the API endpoint we pay attention to 3 fieldsÂ
- status
- tmxImportStatus
- importTime
The following table shows how we map those three fields values to our internal TM status
What's happening with the TM in t5memory | status | tmxImportStatus | importTime | reorganizeStatus | How translate5 considers this TM |
---|---|---|---|---|---|
Not found | not found | N/A | N/A | N/A | Error |
Available | available | N/A | N/A | N/A | Available |
Just opened | open | N/A | N/A | N/A | Available |
Additional file import not finished | open | available | not finished | N/A | Import |
Primary file import not finished | open | import | N/A | N/A | Import |
Waiting to be loaded | waiting for loading | N/A | N/A | N/A | Waiting for load |
Loading | loading | N/A | N/A | N/A | Loading |
Failed to load | failed to open | N/A | N/A | N/A | Failed to load |
Import finished successfully | open | available | finished | N/A | Available |
Import finished with error | open | error | N/A | N/A | Error |
Import failed | open | failed | N/A | N/A | Error |
Reorganize in progress | open | N/A | N/A | reorganize | Reorganize in progress |
Reorganize failed | open | N/A | N/A | reorganize failed | Reorganize failed |
Reorganize finished | open | N/A | N/A | available | Available |
In case status or tmxImportStatus contains something that is not mentioned in table above we consider TM status to be Unknown