用語のロケールが用語集の対象外

Moses Skodaエンジニア読了目安 1分

この問題が発生すると、API は 422 Unprocessable Content を返します。その type は https://lingo.dev/docs/api/errors/glossary-term-locale-not-covered です。すべてのエラーに共通する形式については、エラーとステータスコードを参照してください。

「<text>」を保存できません。この用語のロケール「<locale>」は、用語集の対象ロケール(<sourceCoverage>)に含まれていません。対象ロケールのいずれかを使用するか、このロケールを用語集の翻訳元の対象ロケールに追加してください。

フィールド#

レスポンス本文には、標準の type、status、title、detail の各メンバーに加え、以下のフィールドが含まれます。detail のテキストはこれらのフィールドから生成されるため、クライアント側で独自のテキストを表示することもできます。

フィールド型
textstring
localestring
sourceCoveragestring[]

例#

json
{
  "detail": "Cannot save \"<text>\". Its locale \"<locale>\" is not one this glossary covers (<sourceCoverage>). Use one of those locales, or add this one to the glossary's source coverage.",
  "text": "<text>",
  "locale": "<locale>",
  "sourceCoverage": [
    "<sourceCoverage>"
  ],
  "type": "https://lingo.dev/docs/api/errors/glossary-term-locale-not-covered",
  "status": 422,
  "title": "Glossary term locale not covered"
}

このエラーを返すエンドポイント#

  • PATCH /v2/glossaries/{glossaryId}/terms/{id}
  • POST /v2/glossaries/{glossaryId}/terms
  • POST /v2/glossaries/{glossaryId}/terms/create-many