Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Import terms to the TermCollection via tbx-file(s)

Request

POST /editor/termcollection/import

ParamscollectionId Required. Id of a TermCollection where terms should be imported to.

tbxUpload Required. Tbx file(s) (or a zip file(s) containing TBX files) uploaded as multipart/form-data. If multiple tbx or zip files are given - they should be uploaded under tbxUpload[0], tbxUpload[1], etc params names.


customerIds Optional. Comma-separated list of customers ids for this termcollection to be associated with.

mergeTerms Optional. Boolean value to merge imported terms with terms already existing (if any) in the target termcollection. By default - false. The merge process is complex and completely described here.

deleteTermsLastTouchedOlderThan Optional. If given, should be a date in YYYY-MM-DD format, so that any terms last updated before that date - will be deleted from the target TermCollection. 'Last updated' date for a term is initially set up as a current date on import and then refreshed each time term is renamed and/or any of it's attributes created/updated/deleted.

'Last updated' date is maintained internally by translate5, and is not directly shown in TermPortal UI. However, it is replicated to 'Updated by'-field in 'Term attributes'-panel in TermPortal UI each time any further change happended to the term itself or it's attributes after initial import.


deleteTermsOlderThanCurrentImport Optional. Boolean value to delete all terms from the target TermCollection, that were last updated before the the start of the current import, and if given as true - it will have the same affect as if the current date is used as a value for the previously described param.

deleteProposalsLastTouchedOlderThan Optional. If given, should be a date in YYYY-MM-DD format, so that any terms last updated before that date and having Process status = Unprocessed - will be deleted from the target TermCollection. Also, any attributes (for any remaining terms) initially imported from tbx and updated since then but before the given date - will be reverted to back to their original values. At the same time, any attributes that were not initially imported from tbx, i.e. created afterwards but before the given date - will be deleted for the any remaining terms in the target TermCollection.

deleteProposalsOlderThanCurrentImport Optional. Boolean value having the same affect as if the current date is used as a value for the previously described param.

Note: there are additional possibilities to import terms into the TermCollection. 

  1. Import tbx files via 'Language resources' tab for the resource of type 'TermCollection', manually, or
    1. programmatically via /editor/languageresourceinstance/ID/import endpoint - you can read more here about it
  2. Using the TermImport Plug-In


Code Block
languagejs
titleResponse
collapsetrue
{
    "success": true
}



Export TermCollection as TBX

Request

GET editor/languageresourceinstance/tbxexport

ParamscollectionId Required. Id of a TermCollection to be exported.

tbxBasicOnly=(0|1) Required. Whether to export only TBX Basic standard attributes + processStatus, rather than all attributes.

exportImages=(0|tbx|zip) Required. Whether to export images:

  • 0 - No. You should explicitly specify that value for this param if you don't want images (if any) to be exported.
  • tbx - Yes, in hex format, embedded in TBX
  • zip - Yes, in media/ folder inside ZIP-archive

Important: response for this endpoint comes with 'Content-Disposition: attachment' HTTP header to provide a direct download of an exported file.

Code Block
languagejs
titleResponse
collapsetrue
raw text/binary contents, depending on whether TermCollection was exported into a tbx or zip file



Export TermCollection as XLSX

Request

GET editor/languageresourceinstance/xlsxexport

ParamscollectionId Required. Id of a TermCollection to be exported.

Important: response for this endpoint comes with 'Content-Disposition: attachment' HTTP header to provide a direct download of an exported file.

Code Block
languagejs
titleResponse
collapsetrue