Interface with XTM Cloud
Background
We finally have chosen a TMS, it's going to be XTM Cloud. To interface with it we want to change our translation process to upload the to be translated strings via an API to the TMS instead of export/importing CSV files.
What to do
Adapt our existing csv import/export script (see #148 (closed)/!64 (merged)) to upload and download the translation via the TMS's API instead.
Instead of exporting to a CSV file the future version we should use XTM isntead.
The script should be able to do following:
- Create a new project
- Name of the branch should be used for the project, ex.:
release-2018-5
. - The project should contain Difference(New strings/Changed strings) between
master
branch and current branch user triggers the script.
- Name of the branch should be used for the project, ex.:
- Update the project
- Use name of the branch and update the project accordingly - with diff between
master
branch and current branch.
- Use name of the branch and update the project accordingly - with diff between
- Download changes from the XTM project for current branch and populate locales accordingly.
- Source language
en_US
- Target languages:
["de_DE", "fr_FR", "es_ES", "it_IT", "pt_BR", "ru_RU", "tr_TR", "zh_CN", "nl_NL", "hu_HU", "pl_PL", "el_GR", "ko_KR", "ar_AR", "ja_JP"]
- customerId
12445
- workflowId
2926
- analysisTemplateId
251759
Resources
- XTM User Manual
- XTM Cloud API documentation
- Should we hit the limits of the above REST API, there is also a legacy SOAP API (Documentation) (We generally would like to avoid using the legacy api but it's listed here for reference)
Notes for testers
Currently with https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/issues/626 we have started to use production serves for XTM. In order to test XTM using test server, couple of changes needs to be adjusted. Here are configurations to to setup in order to successfully test using test server:
const restApiUrl = "https://wstest2.xtm-intl.com/rest-api";
const customerId = 12445;
const workflowId = 2926;
const analysisTemplateId = 251759;
const subjectMatterId = 1069;
const projectManagerId = MANAGER_ID; // Change MANAGER_ID to a test XTM user ID
To create a project and upload all changed strings run command below from desired branch(not master
):
`USER_ID='111' CLIENT='NAME' PASSWORD='PSWD' npm run $ xtm.create`
- The created project will contain same branch name from which the command has been run.
- Only changes difference between the branch the command has been run and
master
branch should be added to the project.
To build the project run:
`USER_ID='111' CLIENT='NAME' PASSWORD='PSWD' npm run $ xtm.build`
- This command just prepare the XTM project to be downloaded.
- Run the command from the same branch which was used to create the project.
to Downloads translation files and update local files accordingly run:
`USER_ID='111' CLIENT='NAME' PASSWORD='PSWD' npm run $ xtm.download`
- Run the command from the same branch which was used to create the project.