Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Currently there are three ways to import terminology into translate5:

  1. Importing a task with terminology into translate5 for editing
    → this is not covered here, since that terminology currently can not be searched in the termportal.
  2. Import a TBX file in the translate5 GUI in the language resources panel. For explanation of options please read below the options of "file-system based term import", as the options are the same.
  3. Provide TBX files with the terminology → use file-system based import
  4. Get TBX files from Across via crossApi

Depending on which way the terminology should be imported, the TermImport Plug-In must be configured.

The configuration files are located

File-system based term import

To import TBX files from the file system into translate5s termCollections use the file-system based import.

For this a configuration file maps the TermCollection name with the file name of the TBX and the collection name with the customer number. In addition the config file defines the import directory, where the files are read from.

Example of the config file for the file system-based import. This file is located under "config" folder inside the TermImport plugin.

TermCollections, that do not exist, will be created by the import.

Configuration

;;;; ATTENTION: the below variables need to be placed above the areas [FileMapping] and [CollectionMapping]

;import directory of the tbx files
importDir=/var/www/translate5/data/tbx-import/filesystem/;

;mergeTerms: Allowed values: true or false. 
;If this is true, terms will be merged as described at https://confluence.translate5.net/display/TAD/Term+Collection. 
;Otherwise all terms will be added to the termCollection, if the ID in the TBX does NOT exist already in the DB
;when the ID of the termEntry of the TBX does already exist in the DB, the terms of this termEntry will always be merged
mergeTerms=true

;Deletes all terms in all listed termCollections, that have a modification date older than the listed one.
;Every term that exists in a TBX gets a new updated date on TBX-import
;The updated date is a date internal to translate5 and different from the modified date of the term, that is shown in the interface
deleteTermsModifiedOlderThan=2018-05-01

;Deletes all terms in all listed termCollections, that have a modification date older than the start of the current import.
;possible values: true or false
deleteTermsOlderThanCurrentImport=true

;Updating a term with its proposal:
;; If in the TermCollection a change to an existing term is proposed
;; and if exactly this change is part of the TBX as a term with a processstatus that is not "unprocessed"
;; then the change will be accepted in the TermCollection.
;; this means: The old term will be replaced with the proposal and the status will be the one from the TBX

;Deletes all term proposals older then deleteTermsModifiedOlderThan date.
;If the deleteTermsModifiedOlderThan is not set, then the current date will be used
;The current date will be used also when deleteTermsOlderThanCurrentImport is true
;possible values: true or false
deleteProposalsOlderThan=true

;;;; ATTENTION: the above variables need to be placed above the areas [FileMapping] and [CollectionMapping]
 
;mapping between tbx file and term collection name
[FileMapping]
Term.tbx=exampletermCollection;
Term1.tbx=exampletermCollection;
Term2.tbx=exampletermCollection;
example2.tbx=exampletermCollection2;
example3.tbx=exampletermCollection3

;mapping between term collection name and customer number
[CollectionMapping]
exampletermCollection3=1000;
exampletermCollection2=1003;

This api call is only allowed for translate5 authenticated PM, Admin and API users.

To use the API as an authenticated user, first a session must be generated. More about how to authenticate and use translate5  API at: REST API

API call for filesystem import

URL:(YOUR_TRANSLATE5_DOMAIN)/editor/plugins_termimport_termimport/filesystem
Available Methods:GET
Specialities:Start the files-system based term import for the files with location defined in the importDir parameter from the filesystem.config
Availability:It is avalable only for PMs (users with system roles PM, Admin or API)

TBX-import by using crossAPI (Across API)

Example of the config file for the file crossapi-based import. This file is located under "config" folder inside the TermImport plugin.

TermCollections, that do not exist, will be created by the import.


configuration

crossAPIurl=http://win.translate5.net
crossExportFilesDir=/var/www/translate5/data/tbx-import/crossapi/
apiUsername=crossapi.user
apiPassword=pass


;mergeTerms: Allowed values: true or false. 
;If this is true, terms will be merged as described at https://confluence.translate5.net/display/TAD/Term+Collection. 
;Otherwise all terms will be added to the termCollection, if the ID in the TBX does NOT exist already in the DB
;when the ID of the termEntry of the TBX does already exist in the DB, the terms of this termEntry will always be merged
mergeTerms=true

;Deletes all terms in all listed termCollections, that have a modification date older than the listed one.
;Since every term that exists in a TBX gets a new updated date on TBX-import, even if it is not changed: Simply set this date to yesterday to delete all terms, that are not part of the current import
;The updated date is a date internal to translate5 and different from the modified date of the term, that is shown in the interface
deleteTermsModifiedOlderThan=2018-05-01

;Deletes all terms in all listed termCollections, that have a modification date older than the the start of the current import.
;possible values: true or false
deleteTermsOlderThanCurrentImport=false

;Deletes all term proposals older then deleteTermsModifiedOlderThan date.
;If the deleteTermsModifiedOlderThan is not set, then the current date will be used
;The current date will be used also when deleteTermsOlderThanCurrentImport is true
;possible values: true or false
deleteProposalsOlderThan=true

;mapping between across export template and term collection
[FileMapping]
template-1.export=exampletermCollection

;mapping between term collection name and customer number
[CollectionMapping]
exampletermCollection3=10001;
exampletermCollection2=10002;
exampletermCollection=123456789;

API call for crossapi import

URL:(YOUR_TRANSLATE5_DOMAIN)/editor/plugins_termimport_termimport/crossapi
Available Methods:GET
Specialities:Start the crossapi-system based term import for the across configuration files with location defined in the crossExportFilesDir parameter from the crossapi.config
Availability:It is avalable only for users with system role "admin" or "api")


  • No labels