Using API to Manage a Translation Project: Part Three

translation.api.pt3

Most large companies have built APIs for their customers because these sets of requirements make web-service mash-ups possible. As you probably guessed, at Text United we created API as well and in this specific blog series, we explain thoroughly how to use it to manage a Translation Project.

If you want to familiarize yourself with our system, in this series you will find the parts of the code along with the descriptions. To make it more of a tutorial, we made our use cases of API Examples available to download and work on.

The example code is a C# console application created in Visual Studio 2017 by our developers (read about the API method it uses here).  The main code of the example is placed in the Main() method of the Program.cs. It includes all the steps needed to create a project, upload files, check the statuses, generate translated versions and download translations.

In the first part of the series, we presented three short steps that explained what are the helper methods you should be familiar with and which method classes you should know before starting the project. Then, we followed with descriptions on how to add the supported languages and company users to the project. In the second part, we explained how to create a project with one .resx file for translation and get a collection of files to check if it’s ready for translation.

Today, we explain how to read the project details and project files. Let’s go!

Step #5: Read the Project Details

After the project kickoff, you can verify its settings. Check for its name, languages and project team. What you may also check is its progress, which for now would obviously be 0% since it just started.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
 "LockContextMatches": true,
 "Lock100Matches": false,
 "ManagerEmail": "pm@non-existent.null",
 "ManagerPhone": "",
 "FilesCount": 1,
 "TranslationMemories": [
 {
 "Entries": 0,
 "Id": 5969,
 "Name": "TestProject",
 "ModificationDateUtc": "2018-06-04T18:33:40.638Z"
 },
 {
 "Entries": 0,
 "Id": 6483,
 "Name": "TestProject (1)",
 "ModificationDateUtc": "2018-06-06T17:11:09.733Z"
 }
 ],
 "TerminologyRepositories": [],
 "Team": [
 {
 "Id": 999995,
 "Name": "John Doe",
 "Email": "johndoe@non-existent.null",
 "Phone": "",
 "IsTranslator": true,
 "IsProofreader": false,
 "IsInCountryReviewer": false,
 "TranslationRate": 0.0,
 "TranslationProductivity": 2500.0,
 "ProofreadingRate": 0.0,
 "ProofreadingProductivity": 0.0,
 "ProofreadedBy": null
 }
 ],
 "Analysis": [
 {
 "Range": "Context Match",
 "Segments": 0,
 "Words": 0,
 "Characters": 0,
 "Percent": 0.0
 },
 {
 "Range": "Repetitions",
 "Segments": 0,
 "Words": 0,
 "Characters": 0,
 "Percent": 0.0
 },
 {
 "Range": "100%",
 "Segments": 0,
 "Words": 0,
 "Characters": 0,
 "Percent": 0.0
 },
 {
 "Range": "85 % - 99 %",
 "Segments": 0,
 "Words": 0,
 "Characters": 0,
 "Percent": 0.0
 },
 {
 "Range": "70 % - 84 %",
 "Segments": 1,
 "Words": 6,
 "Characters": 34,
 "Percent": 33.3333321
 },
 {
 "Range": "0 % - 69 %",
 "Segments": 2,
 "Words": 12,
 "Characters": 69,
 "Percent": 66.6666641
 },
 {
 "Range": "Total",
 "Segments": 3,
 "Words": 18,
 "Characters": 103,
 "Percent": 100.0
 }
 ],
 "Id": 42217,
 "Name": "Testing API - 1",
 "ManagerId": 999994,
 "ManagerName": " ",
 "OwnerId": 999994,
 "OwnerName": " ",
 "SourceLanguageId": 41,
 "TargetLanguageId": 54,
 "SourceLanguageCode": "EN",
 "TargetLanguageCode": "DE",
 "CreationDateUtc": "2018-06-09T12:52:57.007Z",
 "StartDateUtc": "2018-06-09T12:52:38.315108Z",
 "EndDateUtc": "2018-06-16T14:52:37.429673Z",
 "Progress": 0,
 "TranslationProgress": 0,
 "ProofreadingProgress": -1,
 "ReferenceNumber": "",
 "Description": "This is a sample project for testing API methods",
 "State": "In progress",
 "Offer": null,
 "PostbackUrl": "",
 "CustomField1": "",
 "CustomField2": ""
}

 

Step #6: Read Project Files

You can check the files in the project to see if they were processed with no errors. In response to the https://www.textunited.com/api/projectfiles?projectId=42217 request, you’ll get basic information about all the files uploaded to the project (in this particular example we have only one file).

The statusNotTranslated” indicates that the file was correctly processed by the system (it was recognized and converted into segments). However, there’s no translated version of the file generated yet. See ApiProjectFile object in the first part of the blog series (Step #0.2) for more information about possible values for the Status property.

1
2
3
4
5
6
7
8
9
10
11
[
 {
 "FileId": 1087770,
 "Filename": "SampleResourceFile.resx",
 "Subdir": "",
 "FileSize": 6157,
 "FileDate": "2018-06-09T14:52:38.955783",
 "Words": 18,
 "Status": "NotTranslated"
 }
]

From the listing above we know the file name is SampleResouceFile.resx, it’s 6157 bytes in size and contains 18 translatable words.

What’s next? Starting to translate, of course! You will find out more about this process the next part of our series.

Stay Tuned!

Related Posts

Gosia
Written By:

Gosia loves copywriting and product translation. Additionally, she's a content marketing and lolcats junkie.

Add a Comment

Your email address will not be published. Required fields are marked *