Connectors / Service / Lokalise

Lokalise

Lokalise

All-in-one software localization and translation management platform.

Overview

Lokalise is an app localization and translation platform designed for the use of project managers with integrated tools for developers and other stakeholders. It enables you to automate the translation and localization workflow of your web and mobile applications, games, and software.

API INFO: The Base URL used for the lokalise connector is https://api.lokalise.com/api2. More information can be found on their main API documentation (v2.0) site.

Authentication

Within the workflow builder, highlight the Lokalise connector.

In the Lokalise connector properties panel to the right of the builder, click on the Authenticate tab and the 'Add new authentication' button.

This will result in a Tray.io authentication pop-up modal. The first page will ask you to name your authentication and select the type of authentication you wish to create ('Personal' or 'Organisational').

The next page asks you for your User Token.

In order to get your User Token, head to your Lokalise dashboard. Click on the "Settings" icon available at the bottom left.

Then click on 'Personal profile'.

Once here, click on 'API tokens'.

On this page, you will get access to your active user tokens. If you have never generated a Lokalise token in the past, you can create a new one by clicking on 'Generate new token'.

Once you have added these fields to your Tray.io authentication pop-up window, click the 'Create authentication' button.

Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

API LIMITATIONS: Lokalise does not rate-limit requests to their API. However, retain a right to decline the service in case of excessive use. Only one concurrent request per token is allowed. To ensure data consistency, it is not recommended to access the same project simultaneously using multiple tokens.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Notes on using Lokalise

Project IDs

Lokalise is a project-oriented platform. This means that while using the connector, you may be asked to input specific project IDs.

In order to get a project ID, head to your dashboard and open one of your projects. On the project page, click on the horizontal hamburger icon, then on 'Settings'.

On this page, you will be able to view the specific 'Project ID'.

Using the Raw HTTP Request ('Universal Operation')

As of version 1.0, you can effectively create your own operations.

This is a very powerful feature which you can put to use when there is an endpoint in Lokalise which is not used by any of our operations.

To use this you will first of all need to research the endpoint in the Lokalise API documentation v2.0, to find the exact format that Lokalise will be expecting the endpoint to be passed in.

Note that you will only need to add the suffix to the endpoint, as the base URL will be automatically set.

The base URL for Lokalise is: https://api.lokalise.com/api2

For example, say that the 'List projects' operation did not exist in our Lokalise connector, and you wanted to use this endpoint. You would use the Lokalise API docs to find the relevant endpoint - which in this case is a GET request called: /projects.

More details about this endpoint can be found here.

As you can see, there is also the option to include multiple query parameters, should you wish to do so. So if you know what your method, endpoint, and details of your query parameters are, you can get all the projects information with the following settings:

Method: GET

Endpoint: /projects

Final outcome being: https://api.lokalise.com/api2/projects

Example Usage

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Lokalise connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

Below is an example of a way in which you could potentially use the Lokalise connector, to download specific project files filtered by name.

The steps will be as follows:

  1. Setup using a manual trigger and list the project files filtered by name.
  2. Add the Loop collection connector to iterate over each file.
  3. Download each file individually.

Your completed workflow should look similar to this:

1 - Setup Trigger & List Project Files

Select the manual trigger from the trigger options available.

From the connectors panel on the left, add a Lokalise connector to your workflow. Set the operation to 'List project files'.

The 'Project Id' field contains all your available projects. You can select a 'Project ID' of your choice from the available dropdown options.

Using the 'Filter Filename' field, you can filter the list of files based on a specific filename. You can provide any file name as per your choice. In our example, the value we have assigned is example.

Please note that the 'Limit' and 'Page' fields are already pre-filled for you, so you need not worry about it at this stage.

Feel free to re-name your steps as you go along to make things clearer for yourself and other users. The operation names themselves often suffice.

Now, when the workflow is run, it will retrieve all the files that belong to the selected project and have example word as a part of the filename.

2 - Add a loop collection

Next, search for the Loop collection connector within your connector panel, and drag it into your workflow as your next step. Set your operations to 'Loop list'.

The Loop Collection connector allows you to iterate through a list of results. In this example, we will use it to iterate through the data found within the previous Lokalise connector step.

In order to specify the list, you want to loop through, start by using the list mapping icon (found next to the list input field, within the properties panel) to generate the connector-snake.

While hovering over the 'List Project Files' step (with the tail end of the connector-snake), select files from the list of output properties displayed. This will auto-populate a jsonpath within your list input field and update the type selector to jsonpath.

For more clarification on the pathways you have available, open the Debug panel to view your step's Input and Output.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray.io, please see our Intro page and Data Guide for more details.
CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

This will enable us to iterate over the list of files, and perform operations for each one, during each loop cycle.

3 - Download Files

The last step is to drag a Lokalise connector inside of the Loop Collection step itself. Set the operation to 'Download files'.

As you can see, this operation requires the ID of the project from which you want to download files and the format of the files you want to download.

Since the files, we are looping through belong to the 'Example project' as selected in the first(List Project Files) step. At this stage, we will choose the same project name as an input for the 'Project ID' field.

For the 'Format' field, provide json as an input as all the selected files are of the JSON format.

PLEASE NOTE: for the 'Download files' operation selecting the format type corresponding to the format of the file we want to download is crucial, otherwise the API will send an error. You can find more info about the supported file formats here

Scrolling down the properties panel, you will find the 'filter filenames' field. Using the connector-snake, find the jsonpath for the 'Filename' field from the previous step. It should appear similar to $.steps.loop-1.value.filename.

Now when this workflow is run, you will receive URLs for downloading every single file. You will also be able to view the file's details when you click through your debug panel and expand the output.

BEST PRACTICES: Whenever you do decide to create your own workflow, please make sure you take a look at our Managing data best practices guide.

All Operations

Latest version:

1.0