@cadolabs/crowdin-cli

中文文档
3.1.0发布于 2026/10/26ISCCommonJS近 30 天下载 3316

Cli 组合工具

中文使用文档
文档目录13 节
  1. 所需资源
  2. CLI 描述
  3. 工作流程示例
  4. 安装
  5. 设置
  6. 命令
  7. 参数
  8. 配置
  9. 链接
  10. 捐款
  11. 许可证
  12. 支助
  13. 作者数

组合工具 Supported by Cado Labs release

Crowdin CLI 优化用于分支工作

Supported by Cado Labs


NPM

所需资源

  • 节点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
}

捐款

贡献规则 | 行为守则

许可证

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

支助

Supported by Cado Labs

作者数

珍雅·古尔

版本与发布记录

@cadolabs/crowdin-cli 共发布 13 个版本,首次发布于 2021/07/27;过去 12 个月发布了 1 个版本。

版本发布日期距今
3.1.0latest2026/10/2614 天前
3.0.222025/09/261.1 年前
3.0.212025/04/251.5 年前
3.0.202025/03/101.7 年前
3.0.192021/09/235 年前
3.0.182021/09/225 年前

关于 @cadolabs/crowdin-cli 的常见问题

@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 和提交记录判断。