1.2.2 • Published 7 years ago
@krds/labels v1.2.2
Label Generator for KRDS
Allows to export translation files for projects via the KRDS Unity API. Designed to support multiple output formats.
Usage
For Kite:
krds-labels --db krds_unity -f kite -o ./application/config/extraFor Lumen:
krds-labels --db krds_unity -f lumen -o ./resources/langFor JSON:
krds-labels --db krds_unity -f json -o ./labels| Option | Meaning |
|---|---|
--db | Database to export labels from |
-f | Output format |
-o | Output path. Wether this is a file or directory depends on the format used |
ENV
You need to set the following ENV variables for it to work
UNITY_URL=https://unity.krds.com
UNITY_TOKEN=<my_token>Formats
kite- Single php filelang.phpcontaining all the labels is written into dir specified by-ooption. Usually it belongs toapplication/config/extrakite08- Alias forkitekite09- Same askitebut class naming compatible with Kite 0.9 and 'Kilex' codebasekilex- Alias forkite09lumen- Output for Lumen framework, one folder/php file per localejson- Renders labels into json files, one file per locale, useful for NodeJS apps
Extending
- For each new format, create a new module in lib (see
lib/kite.jsfor reference) - Extend
index.jsto recognize the new format
TODO
- Additional formats