How To Use 
Register an account

Try For Free Now

Dark

Light

Announcement: End of support for old file type in File Translation (08/24)

Announcemnet: System Maintenance (Update: September 17)

Announcement: End of support for old file type in File Translation (08/24)

USER DICTIONARY
Update an user dictionary entry
Update an user dictionary entry.
User dictionary is only applied to T-4OO engine, Real-time. T-3MT engine.
Endpoint
Request details
PUT
https://translate.rozetta-api.io/api/v1/dictionary/<id>
Path parameter
Path parameter
Description
id
Entry ID.
Header
Header
Description
Content-Type
application/json
accessKey, nonce, signature
Please refer to the authentication section.
Body
Key
Required
Description
fromLang
O
The language of the original text. Except for languages such as zh-CN and zh-TW, please use the ISO 639-1 code. To get the list of supported languages, please refer to Languages section.
fromText
O
The text to map from. Up to 255 charaters. About counting, please refer to "Charater Count method" in Count Method.
toLang
O
The language of the translated text. Except for languages such as zh-CN and zh-TW, please use the ISO 639-1 code. To get the list of supported languages, please refer to Languages section.
toText
O
The text to map to. Up to 255 charaters. About counting, please refer to "Charater Count method" in Count Method.
Request Sample
{
  "fromLang": "en",
  "fromText": "square",
  "toLang": "ja",
  "toText": "二乗",
}
Response
Key
Description
status
For successfully updating of an entry, this field will be "success". For unsuccessful requests, this field will be "failure".
Response Sample
{
  "status": "success"
}
Limitation
Limitation
Only 3 or less words of User Dictionary can be applied in one sentence when using real-time translation engine. For example: "猫"→"Kitty" "犬"→"Marutaro" "ウサギ"→"Peter" "クマ"→"Teddy" When send request below ["これはです。それはです。ウサギクマも動物です。", "ウサギクマも可愛いです。"] The result will be like: ["This is Kitty. It is Marutaro. Both Peter and bears are animals.", "Both Peter and Teddy are cute."] ※For there are 3 user dictionaries:「猫」、「犬」、「ウサギ」are applied in first sentence, 「クマ」 will not be applied.

api/v1/dictionary/<id>
Update an user dictionary entry from "square" to "二乗".
func UpdateUserDictionaryEntry(basePath string) {
  apiURL := "/api/v1/user/TEST/dictionary/12"

  requestJson := &UserDictionaryEntry{
      FromLang: "en",
      FromText: "square",
      ToLang: "jp",
      ToText: "二乗"}
  jsonValue, _ := json.Marshal(requestJson)

  client := &http.Client{}
  req, err := http.NewRequest(
      "PUT",
      GetFullUrl(basePath, apiURL),
      bytes.NewBuffer([]byte(jsonValue)),
  )
  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("accessUser", "TEST")
  res, err := client.Do(req)

  if err != nil {
      fmt.Printf("The HTTP request failed with error %s\n", err)
  } else {
      data, _ := ioutil.ReadAll(res.Body)
      fmt.Println(string(data))
  }
}
About the authentication, please refer to the authentication section.
About full sample code of each languages, please refer tohere
©️ 2019 Rozetta API  ・  Powered by Rozetta

Rozetta Corp.

^