GALAglobal / translationapi

The API is for anyone who wants to adopt best practices for a translation services API to interact with counterparts directly from your application or content management system. The API helps ensure interoperability for the most common tasks.
https://translate.taus.net/translate/taus-translation-api
MIT License
12 stars 3 forks source link

Pre-populated translation requests have incorrect/missing data #23

Open achimr opened 9 years ago

achimr commented 9 years ago

Steps to reproduce:

  1. Launch server with "node taustranslationserver.js"
  2. Add at least one new transationrequest to pre-populated requests by POSTing a translate request
  3. Get all translations with by GETing http://localhost:3412/v2.0/translation/

Result: [ { "translationRequest": { "id": "fb25dc8c-fa61-456c-ba0b-14675e049aae", "sourceLanguage": "DE-DE", "targetLanguage": "EN-US", "source": "Das ist ein Test.", "target": null, "mt": false, "crowd": false, "professional": false, "postedit": false, "comment": "We need a fast translation", "translator": "", "owner": "TAUS", "creationDatetime": "2014-05-20T19:20+01:00", "status": "initial" } }, { "translationRequest": { "id": "1589d67b-f61d-41d9-df21-022e769acaa5", "sourceLanguage": "FR-FR", "source": "Das ist ein Test nach Französisch.", "target": "", "mt": false, "crowd": false, "professional": false, "postedit": false, "comment": "We need a fast translation", "translator": "", "owner": "Heartsome", "creationDatetime": "2014-05-20T19:20+01:00", "status": "initial" } }, { "translationRequest": { "id": "d379f492-9b9f-4061-d60a-1462dc1b09be", "sourceLanguage": "DE-DE", "targetLanguage": "EN-GB", "source": "Hallo Welt", "professional": true, "mt": false, "creationDatetime": "2014-05-20T19:20+01:00", "updateCounter": 0, "status": "initial" } }, { "translationRequest": { "id": "2b575fdc-f6af-4b9e-850d-9dc0884c6595", "sourceLanguage": "de-DE", "targetLanguage": "en-US", "source": "Hallo Welt", "mt": false, "professional": true, "status": "initial", "creationDatetime": "2014-10-14T14:51:06.670Z", "updateCounter": 0, "links": [ { "rel": "translation", "href": "http://localhost:3412/v2.0/translation/2b575fdc-f6af-4b9e-850d-9dc0884c6595", "type": "application/json", "title": "Newly created translation request 2b575fdc-f6af-4b9e-850d-9dc0884c6595 + created on Tue Oct 14 2014 10:51:06 GMT-0400 (Eastern Daylight Time)", "verb": "GET" }, { "rel": "translation.cancel", "href": "http://localhost:3412/v2.0/translation/cancel/2b575fdc-f6af-4b9e-850d-9dc0884c6595", "title": "Cancel translation request 2b575fdc-f6af-4b9e-850d-9dc0884c6595", "type": "application/json", "verb": "PATCH" }, { "rel": "translation.reject", "href": "http://localhost:3412/v2.0/translation/reject/2b575fdc-f6af-4b9e-850d-9dc0884c6595", "title": "Reject translation request 2b575fdc-f6af-4b9e-850d-9dc0884c6595", "type": "application/json", "verb": "PATCH" }, { "rel": "translation.confirm", "href": "http://localhost:3412/v2.0/translation/confirm/2b575fdc-f6af-4b9e-850d-9dc0884c6595", "title": "Confirm translation request 2b575fdc-f6af-4b9e-850d-9dc0884c6595", "type": "application/json", "verb": "PATCH" }, { "rel": "translation.accept", "href": "http://localhost:3412/v2.0/translation/accept/2b575fdc-f6af-4b9e-850d-9dc0884c6595", "title": "Accept translation request 2b575fdc-f6af-4b9e-850d-9dc0884c6595", "type": "application/json", "verb": "PATCH" }, { "rel": "translation.patch", "href": "http://localhost:3412/v2.0/translation/2b575fdc-f6af-4b9e-850d-9dc0884c6595", "title": "Patch translation request 2b575fdc-f6af-4b9e-850d-9dc0884c6595", "type": "application/json", "verb": "PATCH" } ] } } ] Issues for first three pre-populated translation requests:

achimr commented 9 years ago
heartsomeXPhantom commented 9 years ago

a) entries changed b) languge identifiers are not checked, taken as they come in; the "wrong" identifiers come from the predefined requests; update to correct langues c) No links only for predefined requests; GUID is generated automatically so links cannot be created correctly for test entries. d) This are test entries, so not all attributes are set. targetLanguage added

BTW: The requests are stored in requests.txt. Thus it is necessary to delete this file to get the changed entries.

A general comment: those entriesd where intedned to serve as tests fpr various tests, so som,e errors where intended. I have changed to a correct version.

achimr commented 9 years ago

I understand that erroneous data entries can be useful for internal tests, but why would they be returned by the test implementation?

heartsomeXPhantom commented 9 years ago

Why can't GUIDs be added to the links if they are available to populate the id attribute?

Time zone changed