Giter Site home page Giter Site logo

ilse's Introduction

Ilse

Ilse is a command-line tool to interact with Lokalise's API.

Installation

You can install Ilse using pip:

pip install git+https://github.com/tflhyl/Ilse.git

Or you can clone this repo and build yourself. Ilse is written in Python and will require its dependencies to be installed before you can use it:

pip install -r requirements.txt

Using Ilse

Configuration

Configuration parameters such as API_TOKEN are to be specified in the .ilseconfig file. Take a look at .ilseconfig.example for an example how it looks like.

Global parameters

Params Remarks
API_TOKEN A valid token that has access to the project.
PROJECT_ID The project ID. Go to project settings to get it.

Resource parameters

Params Remarks
FORMAT The format of translation files. See supported formats here
LANGUAGES The translation language ISO codes
FILES_DIR Path to the directory of translation files. Placeholder %LANG_ISO% will be replaced by the ISO code or anything defined in FILES_DIR_MAP
FILES_NAME The translation files name. Placeholder %FORMAT% will be replaced by the format specified in FORMAT
FILES_DIR_MAP Mapping for language ISO codes to the custom or platform specific codes used in the directory path (e.g. zh_TW:zh-Hant)

Pushing Translations

For a project in clean state, you probably need to push all the translation files:

ilse push --replace

Note the --replace flag is needed because there's a bug in Lokalise that won't register the plurals translations on some platforms.

To push specific language (e.g. to update source language which needs translations):

ilse push -l en [--replace]

--replace flag is optional. If it is not set, any updated values on existing keys will be ignored. However most of the time we do want to keep the translations on lokalise up to date with our local copies, so it is recommended to always use --replace flag. When we update some values on base language, we also want translators to re-translate them. Lokalise will mark updated keys as fuzzy to indicate this if we turn on 'Auto-toggle fuzzy' option in the project settings.

You can use --overwrite flag to completely overwrite all the keys and values with the new uploaded files. This is useful in case for example you delete some keys on your files and want it to be reflected on lokalise (without overwriting, the keys won't be deleted on lokalise).

Pulling Translations

To pull the translation files from Lokalise:

ilse pull

The downloaded files will be automatically extracted to the correct directory and overwrite existing files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.