Skip to main content

Rigi Documentation

Rigi CLI tool

Rigi CLI is a .NET Command Line Interface application designed to synchronize resource files between development repositories and the project on the Rigi server.

Download the tool (Windows, Linux, and macOS)

Use this link to download various versions of the Rigi CLI tool.

Use cases:

  • Synchronize a project on the Rigi server with the code repository as part of CI/CD.

  • Integrate upload and download within a Git action (e.g., on each merge of a new feature).

Key tasks:

  • Uploads resource files from a local copy of a code repository to the project on the Rigi server and gets files with Rigi tokens (Upload mode).

  • Downloads resource files with translations and copies them to the correct location in the local repository (Download mode).

  • (Optional) Uploads resource files with translations and overwrites target translations on the Rigi server (Align mode).

General concept of CI Pipeline

The application is designed to be run automatically by CI/CD solutions.

pipeline.png

Automated retrieval of translated content from Git repositories (general concept)

The environment for automatic file retrieval can be created using any service that creates CI/CD pipelines in Git.

For this example, we have created a new Rigi project.

example1.png

This project has one source file (json). The target rules are defined so the target files are placed in the same folder and named <language>.json.

This project contains 56 source strings translated and validated in Japanese, German, and Italian.

Example2.png

Initial state: all target languages have 100% validated translations for 56 strings.

Upload mode

  • Prerequisites: The developers have implemented new features, including 33 new strings in the source JSON file.

    In this example, the manifest contains absolute paths and is located outside the repository.

    [
     {
     "filepath": "C:\\repos\\clitest\\en.json",
     "fileId": "en",
     "parserId": "json",
     "targetRule": "TR_json"
     }
    ]
  • Actions: Rigi CLI is used to update the Rigi project with the new source files via the Upload mode.

    upload -url https://xyz.rigi.io/projects/174 
           -repo C:\repos\clitest 
           -manifest manifest.json 
           -username jdoe@xyz.com -password "xxxxxxxxx"

    To do so, a command line is run from a random folder:

    Rigi-CLI.exe upload -url https://xyz.rigi.io/projects/174 -repo C:\repos\clitest -manifest C:\repos\clitest\manifest.json -username jdoe@xyz.com -password "xxxxxxxxx"
  • Result: This results in the following output:

    Remote project URL: https://xyz.rigi.io/projects/174
    Authentication...
    -> POST https://xyz.rigi.io/api/auth/login
    Target files unpacked in location: C:\repos\clitest

    The project was updated with the new source strings. Their translation status is set to Untranslated.

    Example4.png

    'EN' and 'RG' are new strings. 'JA' already existed.

    The target folder now contains the files with Rigi tokens:

    Example_5.png

    en-JM contains the Rigi tokens

Align mode

  • Prerequisites: The developers have applied machine translations to the Japanese, German, and Italian target files.

    Example6.png

    Target files with MT translations.

    They copied the files containing the translations to the local repository at the location that matched the target rules. A targetfiles.txt file lists all paths of the target files:

    Example7.png

    The targetfiles.txt file lists all JSON files containing translations.

  • Actions: Rigi CLI is used to align the Untranslated strings with translations from the target files and set them as Translated. To do so, a command line is run from a random folder:

    Rigi-CLI.exe download -url https://xyz.rigi.io/projects/174 -targetfolder C:\repos\clitest -pseudo -master -username jdoe@xyz.com -password "xxxxxxxxx"
  • Result: This results in the following output:

    Remote project URL: https://xyz.rigi.io/projects/174 
    Authentication...
    -> POST https://xyz.rigi.io/api/auth/login
    -> GET https://xyz.rigi.io/api/projects/174
    -> POST https://x.rigi.io/api/projects/174/workspaces/align
    Align completed

    The Untranslated texts are now aligned with translations from the target files and set to Translated:

    Example9.png

    The new strings ('Language', 'EN', and 'RG') are aligned with the translations from the German de-DE.json file.

    The dashboard shows that all 89 source strings were translated for all target languages:

    Example10.png

Download mode

  • Prerequisites: In the Rigi project, a translator or reviewer has changed the German translations and set the status to Reviewed.

    Example11.png

    The linguist has approved or edited all of the 'Translated' strings and set their status to 'Reviewed'.

  • Actions: Rigi CLI is used to download the files containing translations. To do so, a command line is run from a random folder:

    Rigi-CLI.exe align -url https://xyz.rigi.io/projects/174 -targetfiles C:\repos\clitest#targetfiles.txt -alignstate Translated -username jdoe@xyz.com -password "xxxxxxxxx"
  • Result: This results in the following output:

    Remote project URL: https://xyz.rigi.io/projects/174
    Authentication...
    -> POST https://xyz.rigi.io/api/auth/login
    -> GET https://xyz.rigi.io/api/projects/174
    Downloading {"addSource": true, "targets": [], "generatePseudo": true, "generateDescriptor": true, "master": true}
    Downloading {"addSource": false, "targets": ["it-IT"], "generatePseudo": false, "generateDescriptor": false, "master": false}
    Downloading {"addSource": false, "targets": ["ja-JP"], "generatePseudo": false, "generateDescriptor": false, "master": false}
    Downloading {"addSource": false, "targets": ["de-DE"], "generatePseudo": false, "generateDescriptor": false, "master": false}

    The downloaded master and target files are now present in the repository:

    Example13.png

    The downloaded German file contains the modifications:

    Example14.png