跳转到主要内容

必需的配置

{
  "storage": {
    "adapter": "smartling",
    "config": {
      "projectID": "your-project-id",
      "userIdentifier": "your-smartling-user-identifier",
      "userSecretEnv": "SMARTLING_USER_SECRET"
    }
  }
}

必填密钥

export SMARTLING_USER_SECRET="your-smartling-user-secret"
userSecret 配置中不支持内联。仅使用环境变量。

可选配置字段

  • targetLanguages
  • timeoutSeconds(默认为30
  • modestrings(默认)或 files
  • fileURI — 当 modefiles 时必填
  • fileFormat — 当 modefiles 时必填(例如 json

模式

  • strings:使用 Smartling 字符串 API 进行拉取和推送。
  • files:使用 Smartling 文件下载/上传 API 进行拉取和推送。

文件模式配置示例

{
  "storage": {
    "adapter": "smartling",
    "config": {
      "projectID": "your-project-id",
      "userIdentifier": "your-smartling-user-identifier",
      "userSecretEnv": "SMARTLING_USER_SECRET",
      "mode": "files",
      "fileURI": "translations.json",
      "fileFormat": "json"
    }
  }
}

常见问题

  • 缺少密钥:在同一个 shell 会话中导出 SMARTLING_USER_SECRET
  • 缺少用户标识符:设置 storage.config.userIdentifier
  • 语言区域不匹配:将 targetLanguages 与你的项目语言区域保持一致
  • 文件模式导入失败:请验证 fileFormat 是否与您的项目设置匹配