Main menu

Import assets and translations from a language pack file


The import API loads translations from various language pack formats into the currently authenticated project.

Take note of how the index and locale parameters are used to describe how your file will be imported. By leaving these fields empty Loco will try to guess your intentions, but it's advisable to specify all parameters if in any doubt. See examples.

It's recommended that you set async=1 for large files. This will cause the import to run in the background. When running asynchronously you will receive a 201 code (instead of 200) and the Location header will contain a URI for checking progress.

When running synchronously the response object will include the state of each locale affected by the import.

See Import settings for full details on all these options.

URI parameters


File extension for the type of file data you're importing

arb | bplist | csv | ini | json | mo | php | plist | po | pot | properties | res | resx | strings | tmx | ts | txt | xlf | xml | yml required

Specify whether translations in your file are indexed by generic IDs or human-readable source text

id | text optional

Specify target locale if importing translations

string optional

Hint for generic file types (like JSON) that don't declare their schema. Reciprocal to the export parameter of the same name

string optional

Specify that import should be done asynchronously (recommended for large files)

boolean optional

Specify original file path for source code references (excluding line number)

string optional

Specify that new assets will NOT be added to the project

boolean optional

Specify that existing assets encountered in the file will NOT be updated

boolean optional

Specify that blank translations should NOT be imported

boolean optional

Tag any NEW assets added during the import with the given tags (comma separated)

string optional

Tag ALL assets in the file with the given tags (comma separated)

string optional

Remove existing tags from any assets matched in the imported file (comma separated)

string optional

Tag existing assets that are MODIFIED by this import

string optional

Remove existing tags from assets that are MODIFIED during import

string optional

Tag existing assets in the project that are NOT found in the imported file

string optional

Remove existing tags from assets NOT found in the imported file

string optional

Permanently DELETES project assets NOT found in the file (use with extreme caution)

boolean optional

Set this flag on any NEW translations imported into the current locale

string optional

Set this flag on any translations MODIFIED during import to the current locale

string optional

API key - required if not sent in Authorization header

string optional

Request body

The POST request body must contain (string) Raw source of file being imported.

Loco's official SDK binds the request body to the "data" parameter. Check the documentation for other libraries.

Request headers


API key sent as "Loco <key>" or "Basic <encoded>". See Authentication.

string required if not in query


A single JSON-encoded ImportResult object, which takes the following form:

    "status": 200, // Whether import was synchronous (200) or asynchronous (201)
    "message": "", // Summary of import result
    "locales": [
            "code": "", // Locale short code, or language tag
            "name": "", // Friendly display name
            "source": false, // Whether the default/source locale of the project
            "plurals": {
                "length": 2, // Number of forms including singular
                "equation": "n != 1", // Equation for calculating offset in forms
                "forms": ["zero","one","two","few","many","other"], // Plural form names
            "progress": {
                "translated": 0, // Number of assets for which a translation exists (including those flagged)
                "untranslated": 0, // Number of assets that are not yet translated to this language
                "flagged": 0, // Number of translations that are flagged as requiring attention
                "words": 0, // Approximate word count for translated texts in this language

Try it

Open in test console »

« /api/import