组合工具

Crowdin CLI 优化用于分支工作
所需资源
- 节点12+
CLI 描述
- 源 - 群集中设置的根语言
- 目标语言 - 项目在群集中设置的所有语言
工作流程示例
- 在源文件中添加密钥和翻译
- 上传只添加到新群集分支
crowdin push-diff -b new-branch - 等待翻译工作
- 下载并合并
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
}
链接
捐款
许可证
依据麻省理工学院的许可获释.
