Usare CLI su CI

Incorpora la localizzazione del tuo progetto di Crowdin nel flusso di lavoro che hai configurato sulla tua repository. Questo include il caricamento automatico delle nuove stringhe sorgente a Crowdin e il download delle traduzioni. This approach ensures effective synchronization of all translatable texts and helps to avoid potential translation delays before the application deployment.

One way to accomplish that is by using Crowdin CLI with your CI tools. You can use Crowdin CLI with built-in CI tools or third-party alternatives. Se usi le Azioni di GitHub per l’automatizzazione del tuo flusso di lavoro, leggi di più sulla nostra Azione di Crowdin di Github.

Casi d’Uso

Continuous Integration (CI) is the development practice of merging code changes from multiple participants into a shared software project several times a day. You can add multiple localization blocks into your workflow to preserve a continuous translation of your app.

Below you can see a visual representation of how you can incorporate localization into your workflow.

CI/CD Pipeline with localization block

To ensure all the texts are localized before final application deployment, you can inject the localization block after each vital step in your CI/CD pipeline (e.g., after initial mockup design, after every app feature development, etc.)

Using Crowdin CLI with Jenkins and Grunt

Use Crowdin CLI with tools like Jenkins and Grunt to automate your regular localization tasks (e.g., uploading source files, downloading finished translations, etc.)

Jenkins

Check out the instructions below to configure various synchronization actions when working with Jenkins.

Ad esempio, per scaricare le traduzioni dal tuo progetto di Crowdin, aggiungi il passaggio della build Esegui shell. For this, in pipeline configuration, select Add build step and insert the following command:

crowdin download -T {your-token} -i {your-project-id} -s "..." -t "..."

Use your Crowdin access token, project id and specify source and translation files.

Grunt

To use Crowdin CLI with Grunt, follow these steps:

  1. Crea un progetto su Crowdin tramite UI o usando un’API.
  2. Una volta creato il progetto, necessiterai del suo id (Progetto > Strumenti > API) e del token d’accesso di Crowdin (Impostazioni del Profilo > API > Nuovo Token > Crea Token).
  3. Create a configuration file crowdin.yml for your app containing project id and Crowdin access token.
  4. Installa la CLI di Crowdin.

Setting up the grunt-exec plugin allows you to execute shell commands:

Per caricare i file sorgente su Crowdin, passa questo comando a grunt-exec:

crowdin upload sources

Per scaricare le ultime traduzioni da Crowdin, passa questo comando a grunt-exec:

crowdin download

Vedi Anche

Questo articolo è stato utile?