# @cadolabs/crowdin-cli 中文文档

规范地址：https://npmcn.com/package/%40cadolabs/crowdin-cli/

版本：3\.1\.0
npm 元数据更新时间：2026-10-26T08:51:43.334Z
中文译文更新时间：2026-11-08T23:17:22.631Z
软件包许可：ISC

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40cadolabs/crowdin-cli
原文对照：https://npmcn.com/package/%40cadolabs/crowdin-cli/?lang=original
项目主页：https://github.com/Cado-Labs/CrowdinCLI#readme
源码仓库：https://github.com/Cado-Labs/CrowdinCLI

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：45.3 kB，44 个文件
- 模块格式：CommonJS
- TypeScript 类型：未声明
- 运行依赖：9 个
- 首次发布：2021-07-26T19:58:09.899Z
- 最新版本发布：2026-10-26T08:51:43.116Z
- 近 30 天下载量：3316（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：13（近 12 个月 1 个）

## 中文简介

Cli 组合工具

## 安装

```sh
npm install @cadolabs/crowdin-cli
```

也可以使用：`pnpm add @cadolabs/crowdin-cli`、`yarn add @cadolabs/crowdin-cli`、`bun add @cadolabs/crowdin-cli`

## README

# 组合工具 [![Supported by Cado Labs](https://github.com/Cado-Labs/cado-labs-logos/raw/main/cado_labs_badge.svg)](https://github.com/Cado-Labs) ![release](https://github.com/Cado-Labs/CrowdinCLI/actions/workflows/release-package.yml/badge.svg)

Crowdin CLI 优化用于分支工作

[![Supported by Cado Labs](https://github.com/Cado-Labs/cado-labs-resources/blob/main/cado_labs_supporting_rounded.svg)](https://github.com/Cado-Labs)

* * *

[![NPM](https://nodei.co/npm/@cadolabs/crowdin-cli.png)](https://www.npmjs.com/package/@cadolabs/crowdin-cli)

-   [所需资源](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-requirements)
-   [CLI 描述](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-cli-description)
    -   [工作流程示例](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-example-workflow)
    -   [安装](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-installation)
    -   [设置](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-setup)
    -   [图标](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-commands)
    -   [参数](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-params)
    -   [配置](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-config)
-   [链接](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-links)
-   [捐款](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-contributing)
-   [许可证](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-license)
-   [支助](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-supporting)
-   [作者数](https://npmcn.com/package/%40cadolabs/crowdin-cli/#readme-authors)

## 所需资源

-   节点12+

## CLI 描述

-   源 - 群集中设置的根语言
-   目标语言 - 项目在群集中设置的所有语言

### 工作流程示例

1.  在源文件中添加密钥和翻译
2.  上传只添加到新群集分支 `crowdin push-diff -b new-branch`
3.  等待翻译工作
4.  下载并合并 `crowdin pull-diff -b new-branch`

### 安装

`npm i @cadolabs/crowdin-cli` 或者说 `yarn add @cadolabs/crowdin-cli`

可安装全局( 运行于 `crowdin`)或项目依赖性(运行) `npx crowdin` 或者说 `yarn crowdin` (建议).

> 检查安装运行 `crowdin -v`

### 设置

写入符号 `.crowdin` 文档.

文件将在命令运行目录中创建

`crowin init --token <crowdin_token>`

何处 `<crowdin_token>` - 在群集配置中生成的 api 令牌 `access all` 复选框

> 在.gitignore 中添加.crowdin

### 命令

`init` - 保存标志 `.crowdin` 文件

`lint` - 检查翻译语法

`push-diff` - 上传翻译 diff( 主分支投放错误)

`pull-diff` - 下载翻译 diff( 主分支投出错误)

`upload-source` - 仅上传源文件

`upload-translations` - 失败。 只上传翻译( 如果未上传源头则扔出错误) .

`upload` 或者说 `push` - UDEPRECATED. pload 源码然后翻译(运行) `upload-source` 财务报告和审定财务报表 `upload-translations`(中文(简体) )

`download` 或者说 `pull` - DDEPECATED. 自动装入所有翻译

`task` - 在人群中创建任务

`clean` - 在人群中去掉分支

`sync` - 失败。 上传源码、翻译和下载

### 参数

`-v` 或者说 `--version` - 显示 CLI 版本

`-h` 或者说 `--help` - 显示帮助

`-b` 或者说 `--branch` -克罗丁分行

`-c` 或者说 `--config` - 配置文件的路径

`-l` 或者说 `--languages` - 逗号分隔语言列表(全部默认). ex. (英语). `crowdin upload -l "ru, en, fr"`

`--silent` - 逐行显示日志,不用动画

`--token` - 成群结队

`--organization` - 集合企业中的组织名称

`--fix` - 纠正错误 `lint` 命令。 注意点! 这个也删了"挤"枝!

`--diff-with` - 对 `push` 或者说 `push-diff` 创建 diff 并带有 coomit/ tag/etc.

`--project-id` - Crowdin项目ID

`--base-dir` - 看"混乱"

`--path` - 看"混乱"

`--use-git-branch-as-default` - 看"混乱"

`--import-eq-suggestions` - 如果翻译与源字符串相同,则定义是否添加翻译

`--auto-approve-imported` - 将上传的译文标为核准

`--skip-untranslated-strings` - 定义是否只导出已翻译字符串

`--skip-format-step` - 堕落了 下载翻译后跳过格式步骤

`--contributors` - 逗号分离的用户 id 列表以分配新任务

### 配置

一些参数可以在配置中被代表.

位置文件 `.crowdin-config.json` 在项目目录中.

`.crowdin-config.json` 文件内容 :

```
{
  "token": string, // api token generated in crowdin profile. Strongly non recommend to place it project config
  "organization": string, // Organization name in crowdin enterprise
  "projectId": string, // Crowdin project ID
  "baseDir": string, // Path to translations/directories to upload in crowdin.
  // Relative to config file or absolute
  // Children directory structure will be saved in crowdin.
  "path": string, // Path to files relative to 'baseDir'
  // Glob syntax allowed
  // File name require on of theese variables: %{id/name/editorCode/twoLettersCode/threeLettersCode/locale/androidCode/osxLocale}!
  // Example: './config/**/locale_prefex.%{twoLettersCode}.yml'
  // For files 'config/dir1/locale_prefex.en.yml' and 'config/dir1/locale_prefex.ru.yml'
  "useGitBranchAsDefault": boolean, // Use git branch by default
  // Blocks uploading to master branch
  // Ignored with param '-b' or '--branch
  "importEqSuggestions": boolean, // Defines whether to add translation if it's the same as the source string
  "autoApproveImported": boolean, // Mark uploaded translations as approved
  "skipUntranslatedStrings": boolean, // Defines whether to export only translated strings
  "contributors": string[], // Comma separated user id list to assign new tasks
  "translateHidden": boolean, // Allow translations upload to hidden source strings
  "skipAssignedStrings": boolean, // Skip strings already included in other tasks
  "exportWithMinApprovalsCount": number, // Defines whether to export only approved strings
  "skipFormatStep": boolean, // Deprecated. Skip format step after download translations
}
```

## 链接

-   [克罗丁活字](https://support.crowdin.com/enterprise/api/)

## 捐款

[贡献规则](https://github.com/umbrellio/guidelines/blob/master/CONTRIBUTING.md) | [行为守则](https://github.com/umbrellio/guidelines/blob/master/CODE_OF_CONDUCT.md)

## 许可证

依据麻省理工学院的许可获释.

## 支助

[![Supported by Cado Labs](https://github.com/Cado-Labs/cado-labs-resources/blob/main/cado_labs_supporting_rounded.svg)](https://github.com/Cado-Labs)

## 作者数

[珍雅·古尔](https://github.com/guljeny)

## 常见问题

### @cadolabs/crowdin-cli 是什么？

Cli 组合工具

### 如何安装 @cadolabs/crowdin-cli？

在项目目录运行 npm install @cadolabs/crowdin-cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 crowdin，可以用 npx crowdin 直接运行。

### @cadolabs/crowdin-cli 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/cadolabs\_\_crowdin-cli 是否存在。

### @cadolabs/crowdin-cli 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @cadolabs/crowdin-cli 可以商用吗？

@cadolabs/crowdin-cli 使用 ISC 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @cadolabs/crowdin-cli 的下载量有多少？

根据 npm 官方下载统计，@cadolabs/crowdin-cli 在 2026/10/09 – 2026/11/07 这 30 天内被下载 3,316 次，日均约 111 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @cadolabs/crowdin-cli 还在维护吗？

最新版本 3\.1\.0 发布于 2026/10/26（14 天前）；至今共发布 13 个版本，其中过去 12 个月发布了 1 个；首次发布于 2021/07/27。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

