Page tree

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:

Requested translation memory does not exist
{
    "status": "not found"
}


Requested translation memory exists but is not loaded into memory
{
    "status": "available"
}


Translation memory exists and loaded into memory
{
    "status": "open",
    "tmxImportStatus": "available",
    "importProgress": 100,
    "importTime": "Overall import time is      : 0:00:01\n",
    "segmentsImported": 1,
    "invalidSegments": 0,
    "invalidSymbolErrors": 0,
    "importErrorMsg": "",
    "lastAccessTime": ""
}


Translation memory exists and loaded into memory
{
    "status": "open",
    "tmxImportStatus": "import",
    "importProgress": 0,
    "importTime": "not finished",
    "segmentsImported": -1,
    "invalidSegments": -1,
    "invalidSymbolErrors": -1,
    "importErrorMsg": "",
    "lastAccessTime": ""
}


Translation memory exists and loaded into memory
{
    "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
How translate5 considers this TM
Not found
not found
N/AN/AError
Available
available
N/AN/AAvailable
Additional file import not finished
openavailablenot finishedImport
Primary file import not finished
openimportN/AImport
Import finished successfully
openavailablefinishedAvailable
Import finished with error
openerrorN/AError
Import failed
openfailedN/AError


In case status or tmxImportStatus contains something that is not mentioned in table above we consider TM status to be Unknown



  • No labels