Docker

Updated 20 days ago ​by Nick Ustinov

Look for our command line tool packaged as Docker image. Perfect if you need platform-independent way to import and export data with Lokalise. See usage examples below.

Export from Lokalise to local directory

API_TOKEN=<your api token>
PROJECT_ID=<project id>
LOCAL_DIR=/tmp
FILE_FORMAT=json
    
docker run \
    -v ${LOCAL_DIR}:/opt/dest \
    lokalise/lokalise-cli lokalise \
    --token ${API_TOKEN} \
    export ${PROJECT_ID} \
    --type ${FILE_FORMAT} \
    --dest /opt/dest

Import local file to Lokalise

API_TOKEN=<your api token>
PROJECT_ID=<project id>
LOCAL_FILE=/tmp/en.json
LANG_ISO=en
    
docker run \
    -v ${LOCAL_FILE}:/opt/src/${LOCAL_FILE} \
    lokalise/lokalise-cli lokalise \
    --token ${API_TOKEN} \
    import ${PROJECT_ID} \
    --file /opt/src/${LOCAL_FILE} \
    --lang_iso ${LANG_ISO}

How did we do