Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zaro/poeditorial
Command line tool for poeditor.com
https://github.com/zaro/poeditorial
Last synced: 3 months ago
JSON representation
Command line tool for poeditor.com
- Host: GitHub
- URL: https://github.com/zaro/poeditorial
- Owner: zaro
- License: mit
- Created: 2020-03-08T10:52:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:52:36.000Z (about 2 years ago)
- Last Synced: 2024-10-14T16:32:42.213Z (3 months ago)
- Language: JavaScript
- Size: 72.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# POEditorial
This is simple cli tool that allows downloading and uploading translation files from POEditor
# Install
npm install -D poeditorial
yarn add -D poeditorial# Configuration
[cosmiconfig](https://www.npmjs.com/package/cosmiconfig) is used for configuration , check it's documentation for all the possible places to put configuration.
The general configuration looks like this :
```json
{
"project-name": {
"defaults":{
"format": "key_value_json",
"updating" : "terms",
},
"languages":{
"languageKey1": "translationFilePath1",
"languageKey2": {
"updating" : "terms_translations",
"file": "translationFilePath2"
}
}
},
...
}
```
For supported formats check : https://poeditor.com/docs/api#projects_export
Supported updating values are here : https://poeditor.com/docs/api#projects_uploadFile paths can be absolute or relative to the directory where configuration is found.
Example using .poeditorialrc:
```yaml
test-project:
defaults:
format: key_value_json
updating: terms
languages:
en:
file: en.json
updating: terms_translations
de: de.json
fr:
file: fr.json
updating: skip
```The above file will set default format `key_value_json` and update mode `terms` for all files
and define `en`,`de` and `fr` languages, where the German file will use the default settings and
the English one will have different updating mode and the French will never be downloaded.
This will result in uploading only terms for German, terms and translations for English,
and skipping upload for french.POeditor API token can be specified either via `--access-token` or environment variable `POEDITOR_TOKEN`
# Usage
## List project
```shell
export POEDITOR_TOKEN=my-token
poeditorial list # List configured project with their ids
poeditorial list --all # List all project
```## Download translations
```shell
poeditorial export # export all configured projects
poeditorial export test-project # export only test-project
```## Upload translations
```shell
poeditorial upload
poeditorial upload test-project # upload only test-project
```