Language pairs

A language pair represents a pair of languages that can be used to configure a job. For example, you can create a language pair for "English to French" and assign it to jobs that require translation from English to French.

The language pair object

Properties

  • idstring

    Unique identifier for the object.

  • bidirectionalboolean

    True if the language pair is bidirectional.

  • disabledboolean

    True if the language pair is disabled.

  • pinnedboolean

    True if the entity is pinned.

  • sourceobject

    The source language.
  • targetobject

    The target language.

language pair object

{
  "id": "6548c16d5136b418fd626e5b",
  "source": { 
    "code": "fr", 
    "name": "French" 
  },
  "target": { 
    "code": "en", 
    "name": "English" 
  },
  "bidirectional": false,
  "pinned": false,
  "disabled": false
}

GET/v2/account/language-pairs

List all language pair

This endpoint allows you to retrieve all the language pair.

Request

GET
/v2/account/language-pairs
curl -G https://api.lsp.expert/v2/account/language-pairs \
  -u {key}: 

Response

[
  {
    "id": "6548c16d5136b418fd626e5b",
    "source": { 
      "code": "fr", 
      "name": "French" 
    },
    "target": { 
      "code": "en", 
      "name": "English" 
    },
    "bidirectional": false,
    "pinned": false,
    "disabled": false,
  },
  {
    "id": "659bf8f35959fed584cd38e1",
    "source": { 
      "code": "en", 
      "name": "English" 
    },
    "target": { 
      "code": "fr", 
      "name": "French" 
    },
    "bidirectional": false,
    "pinned": false,
    "disabled": false,
  }
  // ...
]

POST/v2/account/language-pairs

Create a language pair

This endpoint allows you to add a new language pair.

Parameters

  • bidirectionalboolean

    True if the language pair is bidirectional.

  • sourcestring

    The code of the source language (ISO code).

  • targetstring Required

    The code of the target language (ISO code).

Request

POST
/v2/account/language-pairs
curl https://api.lsp.expert/v2/account/language-pairs \
  -u {key}: \
  -d source="en-US" \ 
  -d target="fr-FR"

Response

{
  "id": "66e7f69da9d8b6741f4a441d",
  "source": { 
    "code": "en-US", 
    "name": "English United States" 
  },
  "target": { 
    "code": "fr-FR", 
    "name": "French France" 
  },
  "bidirectional": false,
  "pinned": false,
  "disabled": false,
}


PUT/v2/account/language-pairs/:id

Update a language pair

This endpoint allows you to perform an update on a language pair. Any parameters not provided will be left unchanged.

Parameters

  • disabledboolean

    disabled

  • pinnedboolean

    True if the entity is pinned.

Request

PUT
/v2/account/language-pairs/:id
curl -X PUT https://api.lsp.expert/v2/account/language-pairs/66e7f69da9d8b6741f4a441d \
  -u {key}: \
  -d pinned=true

Response

{
  "id": "66e7f69da9d8b6741f4a441d",
  "source": { 
    "code": "en-US", 
    "name": "English United States" 
  },
  "target": { 
    "code": "fr-FR", 
    "name": "French France" 
  },
  "bidirectional": false,
  "pinned": true,
  "disabled": false,
}

DELETE/v2/account/language-pairs/:id

Delete a language pair

This endpoint allows you to delete a language pair.

Request

DELETE
/v2/account/language-pairs/66e7f69da9d8b6741f4a441d
curl -X DELETE https://api.lsp.expert/v2/account/language-pairs/66e7f69da9d8b6741f4a441d \
  -u {key}: