• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

crowdin/crowdin-cli: A command-line client for the Crowdin API

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

crowdin/crowdin-cli

开源软件地址(OpenSource Url):

https://github.com/crowdin/crowdin-cli

开源编程语言(OpenSource Language):

Java 99.5%

开源软件介绍(OpenSource Introduction):

Crowdin CLI Tweet GitHub Repo stars

Crowdin CLI is a command line tool that allows you to manage and synchronize your localization resources with your Crowdin project. Using CLI, you can:

  • automate the process of updating your source files in your Crowdin project
  • download translations from Crowdin and automatically save them in the correct locations
  • upload all your existing translations to Crowdin in minutes
  • integrate Crowdin with GIT, SVN, Mercurial, and other software

This is a cross-platform and it runs in a terminal on Linux based and macOS operating systems or in Command Prompt on Windows.

Table of Contents


Features

  • Interactive generation of a configuration file
  • Upload source files and existing translations to a Crowdin project
  • Download latest translations from Crowdin to the specified place
  • Show translation and proofreading progress for a project
  • Manage source strings in a Crowdin project
  • Manage glossaries and translation memories
  • Show a list of source files and branches in the current project
  • List information about the source files or translations that match the wild-card pattern contained in the current project
  • Multithreading for source and translation files upload
  • Bash/Zsh command completion
  • Process indicators, loading states, emojis
  • HTTP Proxy support including authorization
  • To explore more features, visit the Wiki, KB article and Configuration File article.

Installation

Requirements

Check if you have Java 8 or newer installed. Type java -version command in the terminal (Command Prompt on Windows) to check Java version.

For example, java version "1.8.0_212" means that you have Java 8 Update 212 installed.

Homebrew for macOS To install the Crowdin CLI with homebrew (the package manager for macOS):
brew tap crowdin/crowdin
brew install crowdin@3
Windows

Download and run installer for Windows.

Debian

We sign all our packages with the Crowdin Signing Key.

Download and install the public signing key:

wget -qO - https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -

Using the following command, create the crowdin.list file in the /etc/apt/sources.list.d directory:

echo "deb https://artifacts.crowdin.com/repo/deb/ /" > /etc/apt/sources.list.d/crowdin.list

And your repository is ready for use. You can install the Crowdin CLI Debian package with:

sudo apt-get update && sudo apt-get install crowdin3

To install the Crowdin CLI manually:

wget https://artifacts.crowdin.com/repo/deb/crowdin3.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
RPM

We sign all our packages with the Crowdin Signing Key.

Download and install the public signing key:

rpm --import https://artifacts.crowdin.com/repo/GPG-KEY-crowdin

Installing from the RPM repository

Create a file called crowdin.repo in the /etc/yum.repos.d directory containing:

/etc/yum.repos.d/crowdin.repo:

[crowdin]
name=Crowdin repository
baseurl=https://artifacts.crowdin.com/repo/rpm
gpgcheck=1
gpgkey=https://artifacts.crowdin.com/repo/GPG-KEY-crowdin
enabled=1

And your repository is ready for use. You can now install Crowdin CLI with one of the following commands:

sudo yum install crowdin3
sudo dnf install crowdin3

To install the Crowdin CLI manually:

wget https://artifacts.crowdin.com/repo/rpm/crowdin3.rpm -O crowdin.rpm
sudo rpm -U crowdin3.rpm
Arch Linux

Visit the Crowdin CLI package page on Arch Linux user repository.

NPM
npm i -g @crowdin/cli
Docker
docker pull crowdin/cli
Standalone Version

Crowdin CLI can be installed as a stand-alone Java application.

Download for MacOS, Linux and Windows

Installation on Linux and macOS

  • Download crowdin-cli.zip using the button above
  • Unpack it
  • Run ./install-crowdin-cli.sh in the terminal with sudo rights in order to add crowdin command to your terminal

Installation on Windows

  • Download crowdin-cli.zip using the button above
  • Extract it's content to the place where you want Crowdin CLI to be stored
  • Open Command Prompt as an Administrator
    • Click Start
    • In the Start Search box, type cmd, and then press CTRL+SHIFT+ENTER
    • If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue
  • Run setup-crowdin.bat script in order to add crowdin command to the Command Prompt
  • Restart your Command Prompt

Running

Use the following method to run the app:

crowdin

Alternative method:

java -jar crowdin-cli.jar

Configuration

Crowdin CLI uses a YAML configuration file that contains a description of the resources to manage: files to be uploaded into Crowdin and the locations of the corresponding translations.

To use Crowdin CLI, you should first generate your configuration file and then run the tool. By default, Crowdin CLI looks for a configuration file named crowdin.yaml or crowdin.yml (so you don’t have to specify the file name unless it’s different from crowdin.yaml).

To create the configuration file run the following command:

crowdin init

When calling Crowdin CLI in terminal make sure you are in your project root directory. Otherwise, you need to specify a configuration file path using --config option:

crowdin upload sources --config /path/to/your/config/file

Sample configuration file:

"project_id": "12"
"api_token": "54e01--your-personal-token--2724a"
"base_path": "."
"base_url": "https://api.crowdin.com" # https://{organization-name}.crowdin.com

"preserve_hierarchy": true

"files": [
  {
    "source" : "/resources/**/*",
    "translation" : "/%two_letters_code%/%original_file_name%"
  }
]


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap