插件:多语言-获取商品专辑翻译
获取指定商品专辑的原始数据和多语言翻译数据。编辑前建议先通过 插件:多语言-翻译语言列表 确认翻译语言,修改后通过 插件:多语言-保存商品专辑翻译 保存。
接口信息
认证
请求头中需要携带 skill-access-token:
| Header |
值 |
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数 (Query)
| 字段 |
类型 |
必填 |
说明 |
collection_id |
int |
是 |
商品专辑 ID |
请求示例
cURL
curl --location --request GET '{your-site-url}/api/skill/addons-language/get-collection-translate?collection_id=358' \
--header 'skill-access-token: {your-skill-access-token}'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
成功响应
{
"code": 200,
"data": {
"collection_data": {
"title": "Summer Dresses",
"body_html": "<p>Custom description here</p>",
"meta_title": "Summer Dresses - Buy Summer Dresses Online",
"meta_keywords": "summer, dresses, online shopping",
"meta_description": "Shop the latest Summer Dresses collection online."
},
"collection_tranlate": [
{
"id": 233,
"shop_id": 15,
"collection_id": 358,
"lang_code": "cn",
"title": "夏季连衣裙",
"body_html": "<p>在此输入自定义描述</p>",
"meta_title": "夏季连衣裙-在线购买夏季连衣裙|跨境电商商店",
"meta_keywords": "夏季,连衣裙,网上购物,跨境电商",
"meta_description": "在线选购最新的夏季连衣裙系列。优质品质,全球发货。",
"created_at": "2026-06-07 16:43:30",
"updated_at": "2026-06-07 16:43:30"
}
]
},
"message": "success"
}
返回字段说明
| 字段 |
类型 |
说明 |
code |
Number |
状态码,200 表示成功 |
message |
String |
执行结果的文字描述 |
data |
Object |
专辑翻译数据 |
data 字段
| 字段 |
类型 |
说明 |
collection_data |
Object |
专辑的默认/基础语言数据 |
collection_tranlate |
Array[Object] |
专辑各语言的翻译数据 |
collection_data 字段(翻译字段)
| 字段 |
类型 |
说明 |
title |
string |
专辑标题 |
body_html |
string |
专辑描述(HTML 格式) |
meta_title |
string |
专辑 SEO 标题 |
meta_keywords |
string |
专辑 SEO 关键词 |
meta_description |
string |
专辑 SEO 描述 |
collection_tranlate 子项字段
| 字段 |
类型 |
说明 |
id |
int |
翻译记录 ID |
shop_id |
int |
店铺 ID |
collection_id |
int |
专辑 ID |
lang_code |
string |
语言简码。与 插件:多语言-翻译语言列表 的 code 对应 |
title |
string |
翻译后标题 |
body_html |
string |
翻译后描述(HTML 格式) |
meta_title |
string |
翻译后 SEO 标题 |
meta_keywords |
string |
翻译后 SEO 关键词 |
meta_description |
string |
翻译后 SEO 描述 |
created_at |
string |
创建时间 |
updated_at |
string |
最后更新时间 |
涉及的翻译字段
商品专辑多语言翻译涉及以下 5 个字段:
| 字段 |
说明 |
title |
专辑标题 |
body_html |
专辑描述(支持 HTML) |
meta_title |
SEO 标题 |
meta_keywords |
SEO 关键词 |
meta_description |
SEO 描述 |
注意事项
collection_tranlate 中可能不含某些语言的翻译(语言刚添加或未编辑),UI 应对缺失语言提供空输入框
- 修改翻译时,通过
lang_code 与保存接口对应,不需要传 id
- 编辑完整流程:翻译语言列表 → 本接口获取翻译数据 → 回填 UI → 保存翻译