Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ibitcy/lokalise-client
⚙️ Client for https://lokalise.co. Easy way to fetch your translations.
https://github.com/ibitcy/lokalise-client
fetch internationalization lokalise translation
Last synced: about 2 months ago
JSON representation
⚙️ Client for https://lokalise.co. Easy way to fetch your translations.
- Host: GitHub
- URL: https://github.com/ibitcy/lokalise-client
- Owner: ibitcy
- Created: 2018-04-11T10:47:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T08:59:21.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T21:48:30.165Z (2 months ago)
- Topics: fetch, internationalization, lokalise, translation
- Language: TypeScript
- Homepage:
- Size: 650 KB
- Stars: 4
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ⚙️ Lokalise-client
[![build status](https://badgen.net/travis/ibitcy/lokalise-client?icon=travis)](https://travis-ci.org/ibitcy/lokalise-client)
[![npm downloads](https://badgen.net/npm/dt/lokalise-client?icon=npm&color=green)](https://www.npmjs.com/package/lokalise-client)Easy way to fetch your translations from lokalise.co.
Based on official [node-lokalise-api](https://github.com/lokalise/node-lokalise-api).
## How to install
```sh
npm i lokalise-client --save-dev
```or
```sh
yarn add lokalise-client --dev
```## Configuration
Create `config` directory in root of your project.
Add `default.json` in `config` directory. Basic example:
```json
{
"translations": {
"dist": "./src/locale/",
"token": "%token%",
"projects": [
{
"id": "%project_id%"
}
]
}
}
```Instead of `json` you can use [other](https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-formats) file format.
You can define several projects. Also you can extend project params by [official lokalise api](https://app.lokalise.com/api2docs/curl/#transition-download-files-post).
## Fetch translations
In your `package.json` file add command `"fetch-translations": "translations fetch"`.
Run command `npm run fetch-translations`.
## Additional options
If you want to save translations files with some prefix, add `prefix` param.
If you want to clean directory with translations each time, set `clean` param to `true`.
If you want to save your translations as flat object, set `useFlat` to `true` and define `delimiter` param.
If you want to save declaration file for your translations, define `declaration` param:
```json
"declaration": {
"dist": "src/models"
}
```