Commands
You can get information about commands in the CLI by running the following command:
polygot -h
To get help for a specific command, run the following command, replacing [command]
by the command name:
polygot help [command]
init
polygot init
Initialize a Polygot project. This command links your Polygot project to your source code. Learn more about project initialization on the configuration documentation page.
languages
polygot languages
Display the list of languages supported by Polygot, with their ISO 639-1 code. Use these ISO codes for commands requesting one or more languages as parameters.
login
polygot login
Authenticate your device to your Polygot account. Authentication is required in order to use the Polygot CLI (except for utility commands). Learn more about CLI authentication on the dedicated page.
logout
polygot logout
Log out from your Polygot account. Learn more about CLI authentication on the dedicated page.
project
create
polygot project create
Start the prompt for the creation of a new Polygot project.
info
polygot project info
Display the current project's information (name, source language, target languages, description).
language
add
polygot project language add <langs>
Add one or several new languages to the current project.
Parameter | Description | Required | Example |
---|---|---|---|
langs | The ISO 639-1 codes of the languages to add | true | fr,it |
polygot translate
or polygot synchronize
command.remove
polygot project language remove <langs>
Remove one or several languages from the current project.
Parameter | Description | Required | Example |
---|---|---|---|
langs | The ISO 639-1 codes of the languages to add | true | fr,it |
list
polygot project list
List all the Polygot projects associated to your account.
pull
sources
polygot pull sources
Pull all the phrase files in the project's source language, and save them on your device.
translations
polygot pull translations [options]
Pull phrase files in one or several languages, and save them on your device to the path defined by your configuration file.
Option | Description | Default | Example |
---|---|---|---|
-l , --language | The ISO 639-1 codes of the languages you want to pull. All languages if none. | None (all languages) | -l fr |
--no-fallback | Disable fallback of missing translations to source phrases. Fallback enabled by default. |
push
sources
polygot push sources
Push all the local source files, found in the paths defined by your configuration file.
translations
polygot push translations [options]
Push all the local translation files, found in the paths defined by your configuration file. This command allows you to import existing translations to your project.
Option | Description | Default | Example |
---|---|---|---|
-l , --language | The ISO 639-1 codes of the languages you want to push. All languages if none. | None (all languages) | -l fr |
status
polygot status
Display the status of your Polygot project. The status indicates whether translations are waiting to be generated, or whether all translations are up to date.
synchronize
polygot synchronize
Synchronize local source files with the Polygot project. The synchronization consists of 3 steps:
- push local sources (equivalent to
polygot push sources
) - launch a translation job (equivalent to
polygot translate
) - pull translations (equivalent to
polygot pull translations
)
translate
polygot translate
Run a translation job, which will generate all translations for the new source phrases.
whoami
polygot whoami
Print the currently logged in user.