الانتقال إلى المحتوى الرئيسي
POST
/
localization
/
translate
Translate a JSON input into any localized file
curl --request POST \
  --url https://api.acedata.cloud/localization/translate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": "# Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph.",
  "locale": "en",
  "extension": "json",
  "model": "gpt-3.5"
}
'
{
  "data": {
    "message.clickButton": {
      "message": "Please click button to apply",
      "description": "Messages which tells user to click button to apply the service."
    }
  },
  "locale": "zh-CN"
}

التفويضات

Authorization
string
header
مطلوب

الترويسات

accept
enum<string>

Specifies the format of the response from the server.

الخيارات المتاحة:
application/json

الجسم

application/json
input
string
مطلوب

The input which need to be translated

مثال:

"# Title 1\n\nThis is a paragraph.\n\n## Title 2\n\nThis is another paragraph."

locale
enum<string>
مطلوب

The target locale which need to be translated to

الخيارات المتاحة:
en,
de,
pt,
es,
fr,
zh-CN,
zh-TW,
it,
ko,
ja,
ru,
pl,
fi,
sv,
el,
uk,
ar,
sr
extension
enum<string>
مطلوب

The file type of the input text

الخيارات المتاحة:
json,
md
model
enum<string>

The LLM which used to translate, default is gpt-3.5

الخيارات المتاحة:
gpt-3.5,
gpt-4

الاستجابة

OK, the prompt has been translated to English.

data
object

The output translated JSON

model
string

The LLM which used to translate

locale
string

The target locale which need to be translated to