---
title: "translationsRegister"
description: "更新资源 ID 下的店铺的翻译语料。你可以基于一个资源 ID 更新对应市场、类型细分下的语料信息。"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/localizations/mutations/translations-register'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/localizations/mutations/translations-register.md'
---
# translationsRegister

更新资源 ID 下的店铺的翻译语料。你可以基于一个资源 ID 更新对应市场、类型细分下的语料信息。

- **Required Scopes:** `write_translation`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Required Permissions

* `write_translation`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md)

## Arguments

* `resourceId`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/id.md)

  资源的唯一标识符。<br></br>样例：商品 ID `16057169190700063316363001`。

* `translations`

  [[TranslationInput!]!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/localizations/inputs/translation-input.md)

  翻译语料信息。

## Returns

* `translations`

  [[Translation!]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/localizations/objects/translation.md)

  语料资源

* `userErrors`

  [[TranslationUserError!]!](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/localizations/objects/translation-user-error.md)

  异常信息

## Examples

### 更新店铺下某一资源 ID 在特定市场、语言下的翻译语料。

更新店铺下某一资源 ID 在特定市场、语言下的翻译语料。

**Request:**

```json
mutation TranslationsRegister {
    translationsRegister(
        resourceId: "gid://shopline/Product/16065881455967920659531950"
        translations: [
            {
                translatableContentDigest: "07ec01a6c4ea382ed6ae7671b7bcf358"
                locale: "DEFAULT"
                value: "Product title"
                key: "title"
                marketId: "2805979406510623080534"
            }
        ]
    ) {
        userErrors {
            code
            field
            message
        }
        translations {
            outdated
            locale
            value
            key
            type
            updatedAt
            market {
                id
            }
        }
    }
}
```

**Response:**

```json
{
  "data": {
    "data": {
      "translationsRegister": {
        "translations": [
          {
            "key": "title",
            "locale": "en",
            "market": {
              "id": "DEFAULT"
            },
            "outdated": false,
            "value": "Default corpus English - Product title"
          }
        ]
      }
    }
  }
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes)。

