术语表术语的目标语言区域存在歧义

Moses Skoda工程师预计阅读 1 分钟

API 会以 422 Unprocessable Content 状态码返回此错误。其 type 为 https://lingo.dev/docs/api/errors/glossary-term-target-ambiguous。所有错误的通用结构,请参阅错误和状态码。

无法保存“<text>”。目标语言区域“<targetLocale>”可使用多种文字系统书写,因此无法指向唯一的语言。请使用“<suggestion>”。

字段#

除标准的 type、status、title 和 detail 成员外,响应体还包含以下字段。detail 文本由这些字段生成,客户端也可以据此显示自定义文本。

字段类型
textstring
targetLocalestring
suggestionsstring[]

示例#

json
{
  "detail": "Cannot save \"<text>\". Target locale \"<targetLocale>\" is written in more than one script, so it does not name a single language. Use \"<suggestion>\".",
  "text": "<text>",
  "targetLocale": "<targetLocale>",
  "suggestions": [
    "<suggestion>"
  ],
  "type": "https://lingo.dev/docs/api/errors/glossary-term-target-ambiguous",
  "status": 422,
  "title": "Glossary term target locale ambiguous"
}

返回此错误的端点#

  • PATCH /v2/glossaries/{glossaryId}/terms/{id}
  • POST /v2/engines/{engineId}/glossary-terms/extract-from-vtt
  • POST /v2/glossaries/{glossaryId}/terms
  • POST /v2/glossaries/{glossaryId}/terms/create-many